13–11 -encrypt: PDF Security Settings

13–11–1 Processing

Sets the password security on the input file.

Note:
* The security information that the input file has will not be carried over to the output PDF file.

  • If the PDF version of the input file is lower, the version will be increased to the PDF version according to the encryption type of the output file. The PDF versions corresponding to each encryption type are shown in the table below.
Table13・1 Table: PDF versions according to encryption types
Encryption Type
PDF Version
 128bit RC4
 1.5
 128bit AES
 1.6
 256bit AES
 1.7

13–11–2 Example of commands

[Executing example commands]

Sets the password security for test.pdf and output it as out.pdf.

[Windows]

AHPDFToolCmd80.exe -encrypt -ownerPass pass123 -filterType 4 -perms2 -print 1 -copy false -d C:\test\test.pdf -o C:\sav\out.pdf

[Linux]

AHPDFToolCmd80 -encrypt -ownerPass pass123 -filterType 4 -perms2 -print 1 -copy false -d /home/antenna/test/test.pdf -o /home/antenna/sav/out.pdf

13–11–3 Folder settings: applied

You can perform batch processing by specifying the input folder to the -d parameter and the output folder to the -o parameter. If a folder is specified, Set the security for the PDF file in the input folder.

Note that the output file will be output to the output folder with the same name as the input file name.

13–11–4 Parameters

Parameter
Content
-userPass Val
[Either -userPass or -ownerPass must be specified]
Sets the password to open the document (also known as the user password).
-ownerPass Val
[Either -userPass or -ownerPass must be specified]
[When specifying -filterType: -ownerPass must be specified]
Sets the owner password.
-filterType Val
Sets the encryption type. Optional.
2: 128bit RC4
3: 128bit AES
4: 256bit AES
If not specified, "4: 256bti AES."
If a value other than 2 to 4 is specified, an error will occur.
If -filterType is specified, -ownerPass must be specified. If it does not exist, an error will occur.
-perms2
Sets the security for "-filterType = 2/3/4." Can be omitted.

-print Val
Sets the printing. Can be omitted.
0: Not allowed 1: Low resolution 2: High resolution
If not specified, "0: Not allowed." If a value other than 0 to 2 is specified, an error will occur.

-modify Val
Sets the document editing. Can be omitted.
0: Not allowed
1: Insert, delete, rotate pages
2: Fill in form fields and sign existing signature fields
3: Create annotations, fill in form fields and sign existing signature fields
4: All operations except page extraction
If not specified, "0: Not allowed."
If a value other than 0 to 4 is specified, an error will occur.

-copy Val
Sets the copying of content. Can be omittedl.
true: Allowed false: Disallowed If not specified, "false: Not allowed"

-accessibility Val
Enable text access for screen reader devices. Can be omitted.
true: enabled false: disabled
If not specified, "true: enabled"
If "-copy" (copy content) is "true", "-accessibility" will automatically be "true." When setting false, specify "-copy false" at the same time.