summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2013-03-11 16:28:11 +0100
committerJay Berkenbilt <ejb@ql.org>2013-03-11 17:37:32 +0100
commit9d4f52c01410c0be08635516675938cd27b41fed (patch)
tree7b4800a88010be2f8417218a8b7cd433538666f2
parentf13558dddb444151f58ffe4cdba5653b2d0a58d5 (diff)
downloadqpdf-9d4f52c01410c0be08635516675938cd27b41fed.tar.zst
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.
-rw-r--r--include/qpdf/QPDFWriter.hh21
1 files changed, 14 insertions, 7 deletions
diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh
index e8b744d2..e2f731d3 100644
--- a/include/qpdf/QPDFWriter.hh
+++ b/include/qpdf/QPDFWriter.hh
@@ -219,13 +219,20 @@ class QPDFWriter
QPDF_DLL
void copyEncryptionParameters(QPDF&);
- // Set up for encrypted output. 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.
+ // Set up for encrypted output. User and owner password both must
+ // be specified. Either or both may be the empty string. Note
+ // that qpdf does not apply any special treatment to the empty
+ // string, which makes it possible to create encrypted files with
+ // empty owner passwords and non-empty user passwords or with the
+ // same password for both user and owner. Some PDF reading
+ // 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
void setR2EncryptionParameters(
char const* user_password, char const* owner_password,