-pdfpermit |
Top Previous Next |
-pdfpermit "PDFPermissions"
The -pdfpermit option sets the permissions allowed for an encrypted PDF file.
The permissions control what actions are allowed on an encrypted PDF file. The list of permissions are as follows:
You can also specify to turn off permissions with the following:
To specify multiple permissions, the PDFPermissions string must be enclosed in double quotes and each permission must be seperated by at least one space. For example, to turn on the modify permission, and turn off the print permissions, the following command-line can be used. DTWAIN_TwainSave("-f pdf -pdfpermit \"modify noprint\"");
To turn off all permissions, the none option can be used. Similarly, to turn on all permissions, all can be used. Note that there are options to turn off and turn on permissions. For example, to turn on all permissions except for the printing: DTWAIN_TwainSave("-pdf -pdfpermit \"all noprint\);
To turn on only the modification and printing permissions: DTWAIN_TwainSave("-f pdf -pdfpermit \"none modify print\"");
When encountering multiple permissions, DTWAIN_TwainSave will read the permissions on the command-line from left to right, setting or unsetting the permissions as they appear in the command-line. Therefore, the following: DTWAIN_TwainSave("-pdf -pdfpermit \"noprint all\"");
will first turn off the printing permission, but will turn it on again since the all permission was the next permission on the command-line.
Therefore, it is recommended that the all permission be used as the first permission if you want to turn off permissions. The all permission will turn on all the permissions, allowing the proper permissions to be turned off when they are encountered on the command line.
Similarly, if you want to start with no permissions and turn on certain permissions, the none permission should be the first permission in the list of permissions, allowing the proper permissions to be turned on when they are encountered on the command line.
Note that in the example above, C/C++ escape sequences are used to embed double quotes in the string. Please consult your language as to the proper way to insert double quotes within quoted strings.
Default Setting: All actions are permitted on the PDF file.
|