Convert documents of HTML to PDF and set PDF password by command line

To protect the contents of the PDF document when you convert the document of html to pdf, it is necessary to set pdf password to protect the contents from being copied, modified, printed, etc. Based on this problem, you can choose the command line application to help you do this work. It is able to convert any printable documents to image formats and you can also use different commands to set parameters for the target file.

The application Document Converter is an excellent application which works in command line application, GUI application and virtual printer application. The command line application is a good helper to software developers because it can be embedded or redistributed in your developed applications. The GUI application is good at batch conversion and the virtual printer application is a wonderful paper and ink saver.

If you want to use the command line application, you can download a free trial version of it at After you install the application on your computer, you will see the executable file doc2pdf.exe which is the called program file in the conversion from html to pdf in installation package. You can call it in MS-DOS interface in the conversion.

If you don’t want to be limited by some functions of the application, you should buy the product at

To convert html to pdf and set pdf password, you should do as follows:

1. Please open MS-DOS interface. You should press “Window”+ “R” or click “Start”—“Run” to open “Run” dialog box. Then please input “cmd” in “Open” combo box and click “OK” button.

2. The command line to be inputted in MS-DOS interface is a combination of four parts: called program, parameters for setting pdf password, source file and target file. Please see the following specific example:

doc2pdf -s openpwd=123 -s ownerpwd=456 -s keylen=0 -s permission=3900 -i C:\test.doc -o C:\out.pdf

In the command line,

doc2pdf stands for called program.

-s openpwd=123 means to set the open password of output pdf document as “123”.

-s ownerpwd=456 is for setting owner password as “456”.

-s keylen=0 stands for the key length as 40 bit RC4 encryption.

-s permission=3900 is the encryption standard for denying anything.

-i C:\test.doc is the path of source file.

-o C:\out.pdf is the path of target file.

3. Please click “Enter” button to run the conversion from html to pdf and you will get the target file several seconds later.

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!