summaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFWriter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDFWriter.cc')
-rw-r--r--libqpdf/QPDFWriter.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc
index 8cdd2759..6cfa6fb9 100644
--- a/libqpdf/QPDFWriter.cc
+++ b/libqpdf/QPDFWriter.cc
@@ -363,11 +363,14 @@ QPDFWriter::setEncryptionParametersInternal(
}
if (V == 4)
{
- encryption_dictionary["/StmF"] = "/CF1";
- encryption_dictionary["/StrF"] = "/CF1";
+ // The spec says the value for the crypt filter key can be
+ // anything, and xpdf seems to agree. However, Adobe Reader
+ // won't open our files unless we use /StdCF.
+ encryption_dictionary["/StmF"] = "/StdCF";
+ encryption_dictionary["/StrF"] = "/StdCF";
std::string method = (this->encrypt_use_aes ? "/AESV2" : "/V2");
encryption_dictionary["/CF"] =
- "<< /CF1 << /AuthEvent /DocOpen /CFM " + method + " >> >>";
+ "<< /StdCF << /AuthEvent /DocOpen /CFM " + method + " >> >>";
}
this->encrypted = true;