How to set the margin and convert MHTML to PDF?

MHTML or MIME HTML is a web page archive format which is saved from a web page and encoded with .MIME encoding. It can be opened and viewed without being online. You can use Microsoft Word to save and open MHTML Web archives. As a matter of fact, there are multiple document converters available on the internet that can be used to convert MHTML to PDF. However, this article would like to introduce HTML Converter Command Line. HTML Converter Command Line does not require you to open the HTML archive. It can help you take only three steps to convert MHTML to PDF. If you want to download this command line application, please click VeryPDF HTML Converter Command Line. It will several seconds to install it in your computer.

The following will show you how to take three steps to set the margin as you convert MHTML to PDF via command line.

Step 1: Open the command prompt window

Four steps are enough to open the command prompt window: click “Start” in the lower-left corner of the computer screen; > click “Run” on the menu; > When the “Run” dialog box appears, enter “cmd” in it. > Click “OK” and the command prompt window will appear on the screen right away.

Open the command prompt window

ready to type a command line?

Step 2: Type a command line

The command line should consist of the following four: the directory of the executable file, the command for margin setting, the directory of the input file and the directory of the output file. Maybe the following pattern can make it clearer.

htmltools -margin <string> <MHTML file> <PDF file>

  • htmltools is the executable file of VeryPDF HTML Converter Command Line.
  • -margin <string> is the command that can be used to set the margin. The angle brackets are usually used to enclose essential contents. string refers to character string. The parameter value following –margin can be divided into four types:
    • -margin 10 : Set margin to 10pt to left
    • -margin 10x10 : Set margin to 10pt to left, top
    • -margin 10x10x10 : Set margin to 10pt to left, top, right
    • -margin 10x10x10x10 : Set margin to 10pt to left, top, right, bottom
  • MHTML file is the input file.
  • PDF file is the output file.

The following command line is a proper example, which is composed of the four items mentioned above, and includes the directories of the files.

D:\htmltools\htmltools.exe -margin 10x10 C:\in\*.mhtml D:\out\*.pdf

  • D:\htmltools\htmltools.exe ---- the directory of the executable file. It represents the executable file htmltools.exe located in the folder htmltools on disk D.
  • -margin 10x10 ---- the command that can be used to set the margin to 10pt to left and top.
  • C:\in\*.mhtml ---- the directory of the input files. The file extension specifies MHTML as the input format. The wildcard * represents all the input files in the folder in on disk C.
  • D:\out\*.pdf ---- the directory of output files. The file extension specifies PDF as the output format. It indicates that all the result files should be placed in the folder out on disk D.

You can replace the directories in the example above with the directories of the files in your computer first, then copy it and paste it to the command prompt window.

Step 3: Press “Enter”

The last step is pretty simple, the only thing you need to do is to press the key “Enter”. Your computer will prompt to convert MHTML to PDF right away. When you see “result=OK” in the command prompt, it means that the computer has converted one of the files. If you want to buy the full version of VeryPDF HTML Converter Command Line, please click Purchase. To get more information of other products, please visit the home page of VeryPDF.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

This entry was posted in HTML Converter (htmltools) and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!