DynaPDF Manual - Page 218

Previous Page 217   Index   Next Page 219

Function Reference
Page 218 of 839
Password encodings
On Windows, Linux, and Unix operating systems passwords are converted to the code page 1252
(WinAnsi) and then to PDFDoc encoding. On Mac OS X or iOS passwords are converted to
MacRoman and then to PDFDoc encoding. PDFDoc encoding is a superset of WinAnsi and
MacRoman encoding that ensures that a password can be correctly interpreted on these operating
systems.
UTF-8 Passwords
All Ansi functions accept UTF-8 Unicode strings as input if the flag gfAnsiStringIsUTF8 is set (see
SetGStateFlags() for further information). However, only the encryption handlers klAES256 and
klAESRev6 support Unicode passwords.
For every other encryption handler DynaPDF converts the string to the code page 1252 on
Windows, Linux, or Unix operating systems, or to MacRoman on Mac OS X and iOS.
Encryption flags
As mentioned earlier only specific flag combinations are allowed to use depending on the
encryption filter. We want now determine how the 40 bit encryption flags can be used in
comparison to the Acrobat input mask. The encryption mask in Acrobat 9 looks as follows:
The combo box at "Printing Allowed" sets the flag rsPrint if printing should be disabled. The combo
box at "Changes Allowed" sets the following flag combinations:
None:
rsModify + rsAddObj
Commenting, Filling in form fields and signing: rsModify
Page layout, filling in form fields:
No additional flags!
Any except extracting pages:
No additional flags!
As you can see above the third and forth options set the same flags. The forth value is just a
duplicate of the third with another description.
The check box "Enable copying of text, images, and other…" sets the flag rsCopyObj if it is unchecked!
Multiple flags must be combined with a binary or operator.
 

Previous topic: Passwords

Next topic: CloseImage, CloseImportFile, CloseImportFileEx