2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-01-05 08:02:11 +00:00

Clarify documentation on encrypted files

Explicitly state how QPDF handles empty passwords when writing files.
Apparently some libraries treat the empty string as the owner password
as an instruction to generate a random password.
This commit is contained in:
Jay Berkenbilt 2013-03-11 11:28:11 -04:00
parent f13558dddb
commit 9d4f52c014

View File

@ -219,13 +219,20 @@ class QPDFWriter
QPDF_DLL QPDF_DLL
void copyEncryptionParameters(QPDF&); void copyEncryptionParameters(QPDF&);
// Set up for encrypted output. Disables stream prefiltering and // Set up for encrypted output. User and owner password both must
// content normalization. Note that setting R2 encryption // be specified. Either or both may be the empty string. Note
// parameters sets the PDF version to at least 1.3, setting R3 // that qpdf does not apply any special treatment to the empty
// encryption parameters pushes the PDF version number to at least // string, which makes it possible to create encrypted files with
// 1.4, setting R4 parameters pushes the version to at least 1.5, // empty owner passwords and non-empty user passwords or with the
// or if AES is used, 1.6, and setting R5 or R6 parameters pushes // same password for both user and owner. Some PDF reading
// the version to at least 1.7 with extension level 3. // products don't handle such files very well. Enabling
// encryption disables stream prefiltering and content
// normalization. Note that setting R2 encryption parameters sets
// the PDF version to at least 1.3, setting R3 encryption
// parameters pushes the PDF version number to at least 1.4,
// setting R4 parameters pushes the version to at least 1.5, or if
// AES is used, 1.6, and setting R5 or R6 parameters pushes the
// version to at least 1.7 with extension level 3.
QPDF_DLL QPDF_DLL
void setR2EncryptionParameters( void setR2EncryptionParameters(
char const* user_password, char const* owner_password, char const* user_password, char const* owner_password,