Xojo Conferences
XDCMay2019MiamiUSA

DynaPDF Manual - Page 191

Previous Page 190   Index   Next Page 192

Function Reference
Page 191 of 766
Because the PDF file can be decrypted without requiring a password if no open password was set, it
is easy to remove the entire encryption settings, this can be done by many tools incl. DynaPDF.
Remarks:
A PDF file can always be decrypted with a PDF library like DynaPDF if the user or owner password
is not set. So, if a PDF file must be secure then both password must be set!
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:
 

Previous topic: Passwords

Next topic: CloseImportFileEx