Convert MHT to PDF and set PDF password

Some of you may want to set PDF password when convert MHT to PDF. For example, if you don’t want others or those who don’t have the passwords to read the PDF files, you would prefer to set PDF open passwords. If you don’t want others or those who don’t have passwords to copy, edit, or change contents of the PDF files, you may prefer to set PDF owner passwords. This article will show you how to set PDF password such as open password when convert MHT to PDF via a command line.

You should start with installing a professional command line application, which is called VeryPDF HTML Converter Command Line. This application has the capacity to help you convert web page files in formats such as HTML, and MHT to PDF very quickly. You can also use it to set PDF properties, for example set PDF password, PDF author, and PDF title via command line. Click and follow the link of VeryPDF HTML Converter Command Line to download and install it on your computer.

After you install this command application, you should open the command prompt window. First, please click Start in the left-down corner on the screen. Then click Run on the menu. After that, type “cmd” in the Run dialog box and click OK to close this dialog and open the command prompt window.

open the command prompt window

When you see the command prompt window on the screen, please type a command line in it according to the basic usage of VeryPDF HTML Converter Command Line.

Usage: htmltools [-openpwd <string>][-keylen <int>] <MHT file> [<PDF file>]

Pay attention, the two options in the above illustration must co-occur. The first option –openpwd <string>can be used to set open password, and the second one -keylen <int> can be used to set the key length and int in it stands for integer.

For instance,

d:\htmltools\htmltools.exe -openpwd "qaz" -keylen 2 c:\in.mht d:\out.pdf

  • d:\htmltools\htmltools.exe is the directory of the main executable file named htmltools.
  • -openpwd "qaz” sets PDF password to be qaz.
  • –keylen 2 sets the key length to be 128 bit RC4 encryption (Acrobat 6 or higher). If the number following –keylen is 1, the key length should be 128 bit RC4 encryption (Acrobat 5 or higher).If the number is 0, the key length would be 40 bit RC4 encryption (Acrobat 3 or higher).
  • c:\in.mht is the directory of the input file.
  • d:\out.pdf is the directory of the output file.

If you want to convert files in batch, you can use the wildcard *. For instance, c:\*.mht stands for all the MHT files on disk C. After you type a proper command line, press Enter on the keyboard. In a couple of seconds, the conversion from MHT to PDF will be finished. If you open the result PDF file, a dialog box will appear to ask you to type the open password as illustrated below. To buy VeryPDF HTML Converter Command Line, please click Purchase.

check the result after set PDF password

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!