Convert web page to PDF and encrypt PDF

Setting passwords is the most commonly used way to encrypt PDF files. There are two types of passwords: open or user passwords ant owner passwords. Open passwords are often used to restrict the opening of PDF files; the unauthorized users can not open or read an open password protected PDF files. Owner passwords are often used to forbidden modification, print and copy. Without an owner password, the user can only read the file but unable to make any change or copy the file.

VeryPDF HTML Tool provides two versions to help you convert web page to PDF and encrypt PDF. Using the GUI version may be easier for some of you, who get used to graphic user interfaces; those who prefer the command line version can save more time and enhance work efficiency. Both versions are available when you click here. This article will focus on the command line version. If you really want to learn the quickest way to convert web page to PDF and encrypt PDF, please click VeryPDF HTML Tool Command Line to download the command line application right way.

The following are the two steps you need to take to convert webpage to PDF and encrypt PDF via command line.

1. Run the Windows Command Prompt

In windows XP, people usually run the Windows Command Prompt as follows: Click Start, > click Run, > type “cmd”, > click OK.

2. Type a command line

You should type a command line, depending on the basic usage as follows: htmltools [options] <web page> [<PDF file>]

The options that can be used to encrypt PDF are as follows:

    1. -openpwd <string> : Set 'open password' to PDF file
    2. -ownerpwd <string> : Set 'owner password' to PDF file
    3. -keylen <int> : Key length (40 or 128 bit)
        1. -keylen 0: 40 bit RC4 encryption (Acrobat 3 or higher)
        2. -keylen 1: 128 bit RC4 encryption (Acrobat 5 or higher)
        3. -keylen 2: 128 bit RC4 encryption (Acrobat 6 or higher)
    4. -encryption <int> : Restrictions
        1. -encryption 0: Encrypt the file only
        2. -encryption 3900: Deny anything
        3. -encryption 4: Deny printing
        4. -encryption 8: Deny modification of contents
        5. -encryption 16: Deny copying of contents
        6. -encryption 32: No commenting
        7. ===128 bit encryption only -> ignored if 40 bit encryption is used
        8. -encryption 256: Deny FillInFormFields
        9. -encryption 512: Deny ExtractObj
        10. -encryption 1024: Deny Assemble
        11. -encryption 2048: Disable high res. printing
        12. -encryption 4096: Do not encrypt metadata

When you set passwords, you must define the key length, too. Hence, either the option -ownerpwd <string> or -ownerpwd <string> must co-occur with the option -keylen <int>. In addition, when you set owner password, you can set encryption option too, so the option -encryption <int> should co-occur with the option for setting owner password , too.

For example, to set an open password and convert web page to PDF, you can type a command line as the following one:

d:\htmltools\htmltools.exe -openpwd "lily” -keylen 2 www.google.com c:\out.pdf

To set an owner password and convert web page to PDF, you can type a command line as follows:

d:\htmltools\htmltools.exe -ownerpwd "lily” -keylen 2 –encryption 3900 www.google.com c:\out.pdf

After you type a command line, please click Enter on your keyboard. If you want to get the full version of VeryPDF HTML Tool Command Line, please click full version.

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!