Convert EMF to PDF and set PDF password

VeryPDF HTML Converter Command Line can help you set PDF password when you convert EMF to PDF. There are two types of passwords: the owner passwords and the open of user passwords. You can set owner passwords to protect your PDF files from being copied, printed, edited, or added other things like watermarks and notes. And you can set open or user passwords to restrict the opening of your PDF files.

This article will show you how to set PDF password via command line when you convert EMF to PDF.

1. Set owner password

1.1. Open the command prompt window

You can open the command prompt window in XP system as follows: click Start, > click Run, > type cmd, > click OK.

1.2. Type a command line and press Enter

Type a command line that can be used to set owner password and convert EMF to PDF in the command prompt according to the following pattern: htmltools [-ownerpwd <string>] [ -keylen <int>] < EMF > [<PDF file>] . In the illustration, the option [-ownerpwd <string>] can be used to set owner password, and the option -keylen <int> , which can be used to set key length, must co-occur with it in a command line. For instance,

d:\htmltools\htmltools.exe -ownerpwd "owner" -keylen 2 c:\in.emf d:\out1.pdf

  • d:\htmltools\htmltools.exe is the directory of the executable file.
  • -ownerpwd "owner" sets owner password to be owner.
  • –keylen 2 sets key length to be 128 bit RC4 encryption(Acrobat 6 or higher). If you change the number to be 0, the key lengh would be 40 bit RC4 encryption (Acrobat 3 or higher). If you change the number to be 1, the key length should be -keylen 1: 128 bit RC4 encryption (Acrobat 5 or higher)
  • c:\in.emf represents the input file.
  • d:\out1.pdf represents the output file.

After you type a proper command line, please press Enter. In a couple of seconds, you can check the result PDF file. When you use Adobe Acrobat or another program to open this PDF file, you will find a little icon of lock on the left. This icon tells that this PDF is protected by password.

the icon will appear after you set PDF password

2. Set open password

2.1. Open the command prompt window

The steps are the same as those in 1.1.

2.2. Type a command line and press Enter

For instance, d:\htmltools\htmltools.exe -openpwd "open" -keylen 2 c:\in.emf d:\out2.pdf

  • d:\htmltools\htmltools.exe is the directory of the executable file.
  • -openpwd "open" sets open password to be open.
  • –keylen 2 sets key length to be 128 bit RC4 encryption(Acrobat 6 or higher). If you change the number to be 0, the key lengh would be 40 bit RC4 encryption (Acrobat 3 or higher). If you change the number to be 1, the key length should be -keylen 1: 128 bit RC4 encryption (Acrobat 5 or higher)
  • c:\in.emf represents the input file.
  • d:\out2.pdf represents the output file.

After you type a command line and press Enter, you when you see “result=OK” in the command prompt window, that means the conversion is done. When you double click the icon of the output PDF file, a dialog box as the following one will pop out, asking you to type the open password.

the effect after set password

To get more information about how to set PDF password and encrypt PDF file via command line and convert documents by VeryPDF HTML Converter Command Line, or to buy this application, please click Purchase.

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

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!