aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--TODO2
-rw-r--r--include/qpdf/QPDF.hh23
-rw-r--r--include/qpdf/qpdf-c.h19
-rw-r--r--libqpdf/QPDF_encryption.cc182
-rw-r--r--libqpdf/qpdf-c.cc63
-rw-r--r--qpdf/qpdf-ctest.c18
-rw-r--r--qpdf/qpdf.cc33
-rw-r--r--qpdf/qpdf.testcov9
-rw-r--r--qpdf/qtest/qpdf.test79
-rw-r--r--qpdf/qtest/qpdf/U25A0.10-ogen.c-check9
-rw-r--r--qpdf/qtest/qpdf/U25A0.10-ogen.check10
-rw-r--r--qpdf/qtest/qpdf/U25A0.10.c-check9
-rw-r--r--qpdf/qtest/qpdf/U25A0.10.check10
-rw-r--r--qpdf/qtest/qpdf/U25A0.11-ogen.c-check9
-rw-r--r--qpdf/qtest/qpdf/U25A0.11-ogen.check10
-rw-r--r--qpdf/qtest/qpdf/U25A0.11.c-check9
-rw-r--r--qpdf/qtest/qpdf/U25A0.11.check10
-rw-r--r--qpdf/qtest/qpdf/U25A0.12-ogen.c-check9
-rw-r--r--qpdf/qtest/qpdf/U25A0.12-ogen.check10
-rw-r--r--qpdf/qtest/qpdf/U25A0.12.c-check9
-rw-r--r--qpdf/qtest/qpdf/U25A0.12.check10
-rw-r--r--qpdf/qtest/qpdf/U25A0.9-ogen.c-check9
-rw-r--r--qpdf/qtest/qpdf/U25A0.9-ogen.check10
-rw-r--r--qpdf/qtest/qpdf/U25A0.9.c-check9
-rw-r--r--qpdf/qtest/qpdf/U25A0.9.check10
-rw-r--r--qpdf/qtest/qpdf/hybrid-xref.10-ogen.c-check9
-rw-r--r--qpdf/qtest/qpdf/hybrid-xref.10-ogen.check10
-rw-r--r--qpdf/qtest/qpdf/hybrid-xref.10.c-check9
-rw-r--r--qpdf/qtest/qpdf/hybrid-xref.10.check10
-rw-r--r--qpdf/qtest/qpdf/hybrid-xref.11-ogen.c-check9
-rw-r--r--qpdf/qtest/qpdf/hybrid-xref.11-ogen.check10
-rw-r--r--qpdf/qtest/qpdf/hybrid-xref.11.c-check9
-rw-r--r--qpdf/qtest/qpdf/hybrid-xref.11.check10
-rw-r--r--qpdf/qtest/qpdf/inline-images.10-ogen.c-check9
-rw-r--r--qpdf/qtest/qpdf/inline-images.10-ogen.check10
-rw-r--r--qpdf/qtest/qpdf/inline-images.10.c-check9
-rw-r--r--qpdf/qtest/qpdf/inline-images.10.check10
-rw-r--r--qpdf/qtest/qpdf/inline-images.11-ogen.c-check9
-rw-r--r--qpdf/qtest/qpdf/inline-images.11-ogen.check10
-rw-r--r--qpdf/qtest/qpdf/inline-images.11.c-check9
-rw-r--r--qpdf/qtest/qpdf/inline-images.11.check10
-rw-r--r--qpdf/qtest/qpdf/lin-special.10-ogen.c-check9
-rw-r--r--qpdf/qtest/qpdf/lin-special.10-ogen.check10
-rw-r--r--qpdf/qtest/qpdf/lin-special.10.c-check9
-rw-r--r--qpdf/qtest/qpdf/lin-special.10.check10
-rw-r--r--qpdf/qtest/qpdf/lin-special.11-ogen.c-check9
-rw-r--r--qpdf/qtest/qpdf/lin-special.11-ogen.check10
-rw-r--r--qpdf/qtest/qpdf/lin-special.11.c-check9
-rw-r--r--qpdf/qtest/qpdf/lin-special.11.check10
-rw-r--r--qpdf/qtest/qpdf/object-stream.10-ogen.c-check9
-rw-r--r--qpdf/qtest/qpdf/object-stream.10-ogen.check10
-rw-r--r--qpdf/qtest/qpdf/object-stream.10.c-check9
-rw-r--r--qpdf/qtest/qpdf/object-stream.10.check10
-rw-r--r--qpdf/qtest/qpdf/object-stream.11-ogen.c-check9
-rw-r--r--qpdf/qtest/qpdf/object-stream.11-ogen.check10
-rw-r--r--qpdf/qtest/qpdf/object-stream.11.c-check9
-rw-r--r--qpdf/qtest/qpdf/object-stream.11.check10
58 files changed, 859 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d5adb70..afe1f628 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2009-09-27 Jay Berkenbilt <ejb@ql.org>
+ * Add several methods to query permissions controlled by the
+ encryption dictionary. Note that qpdf does not enforce these
+ permissions even though it allows the user to query them.
+
* The function QPDF::getUserPassword returned the user password
with the required padding as specified by the PDF specification.
This is seldom useful to users. This function has been replaced
diff --git a/TODO b/TODO
index 80d5f407..84488e3e 100644
--- a/TODO
+++ b/TODO
@@ -12,8 +12,6 @@
Stefan Heinsen <stefan.heinsen@gmx.de> in August, 2009. He seems
to like to send encrypted mail. (key 01FCC336)
- * Translate the encryption dictionary data to human-readable form
-
* Improve the error message generated when processing the broken
files...ideally we should provide the object number currently being
read
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh
index 1a5ed649..34e0842c 100644
--- a/include/qpdf/QPDF.hh
+++ b/include/qpdf/QPDF.hh
@@ -128,6 +128,29 @@ class QPDF
DLL_EXPORT
bool isEncrypted() const;
+ DLL_EXPORT
+ bool isEncrypted(int& R, int& P);
+
+ // Encryption permissions -- not enforced by QPDF
+ DLL_EXPORT
+ bool allowAccessibility();
+ DLL_EXPORT
+ bool allowExtractAll();
+ DLL_EXPORT
+ bool allowPrintLowRes();
+ DLL_EXPORT
+ bool allowPrintHighRes();
+ DLL_EXPORT
+ bool allowModifyAssembly();
+ DLL_EXPORT
+ bool allowModifyForm();
+ DLL_EXPORT
+ bool allowModifyAnnotation();
+ DLL_EXPORT
+ bool allowModifyOther();
+ DLL_EXPORT
+ bool allowModifyAll();
+
// Helper function to trim padding from user password. Calling
// trim_user_password on the result of getPaddedUserPassword gives
// getTrimmedUserPassword's result.
diff --git a/include/qpdf/qpdf-c.h b/include/qpdf/qpdf-c.h
index 2f0096f5..11dae4f1 100644
--- a/include/qpdf/qpdf-c.h
+++ b/include/qpdf/qpdf-c.h
@@ -161,6 +161,25 @@ extern "C" {
DLL_EXPORT
QPDF_BOOL qpdf_is_encrypted(qpdf_data qpdf);
+ DLL_EXPORT
+ QPDF_BOOL qpdf_allow_accessibility(qpdf_data qpdf);
+ DLL_EXPORT
+ QPDF_BOOL qpdf_allow_extract_all(qpdf_data qpdf);
+ DLL_EXPORT
+ QPDF_BOOL qpdf_allow_print_low_res(qpdf_data qpdf);
+ DLL_EXPORT
+ QPDF_BOOL qpdf_allow_print_high_res(qpdf_data qpdf);
+ DLL_EXPORT
+ QPDF_BOOL qpdf_allow_modify_assembly(qpdf_data qpdf);
+ DLL_EXPORT
+ QPDF_BOOL qpdf_allow_modify_form(qpdf_data qpdf);
+ DLL_EXPORT
+ QPDF_BOOL qpdf_allow_modify_annotation(qpdf_data qpdf);
+ DLL_EXPORT
+ QPDF_BOOL qpdf_allow_modify_other(qpdf_data qpdf);
+ DLL_EXPORT
+ QPDF_BOOL qpdf_allow_modify_all(qpdf_data qpdf);
+
/* WRITE FUNCTIONS */
/* Set up for writing. No writing is actually performed until the
diff --git a/libqpdf/QPDF_encryption.cc b/libqpdf/QPDF_encryption.cc
index 2e0e59e7..5d061dfd 100644
--- a/libqpdf/QPDF_encryption.cc
+++ b/libqpdf/QPDF_encryption.cc
@@ -463,3 +463,185 @@ QPDF::isEncrypted() const
{
return this->encrypted;
}
+
+DLL_EXPORT
+bool
+QPDF::isEncrypted(int& R, int& P)
+{
+ if (this->encrypted)
+ {
+ QPDFObjectHandle trailer = getTrailer();
+ QPDFObjectHandle encrypt = trailer.getKey("/Encrypt");
+ QPDFObjectHandle Pkey = encrypt.getKey("/P");
+ QPDFObjectHandle Rkey = encrypt.getKey("/R");
+ P = Pkey.getIntValue();
+ R = Rkey.getIntValue();
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+static bool
+is_bit_set(int P, int bit)
+{
+ // Bits in P are numbered from 1 in the spec
+ return (P & (1 << (bit - 1)));
+}
+
+DLL_EXPORT
+bool
+QPDF::allowAccessibility()
+{
+ int R = 0;
+ int P = 0;
+ bool status = true;
+ if (isEncrypted(R, P))
+ {
+ if (R < 3)
+ {
+ status = is_bit_set(P, 5);
+ }
+ else
+ {
+ status = is_bit_set(P, 10);
+ }
+ }
+ return status;
+}
+
+DLL_EXPORT
+bool
+QPDF::allowExtractAll()
+{
+ int R = 0;
+ int P = 0;
+ bool status = true;
+ if (isEncrypted(R, P))
+ {
+ status = is_bit_set(P, 5);
+ }
+ return status;
+}
+
+DLL_EXPORT
+bool
+QPDF::allowPrintLowRes()
+{
+ int R = 0;
+ int P = 0;
+ bool status = true;
+ if (isEncrypted(R, P))
+ {
+ status = is_bit_set(P, 3);
+ }
+ return status;
+}
+
+DLL_EXPORT
+bool
+QPDF::allowPrintHighRes()
+{
+ int R = 0;
+ int P = 0;
+ bool status = true;
+ if (isEncrypted(R, P))
+ {
+ status = is_bit_set(P, 3);
+ if ((R >= 3) && (! is_bit_set(P, 12)))
+ {
+ status = false;
+ }
+ }
+ return status;
+}
+
+DLL_EXPORT
+bool
+QPDF::allowModifyAssembly()
+{
+ int R = 0;
+ int P = 0;
+ bool status = true;
+ if (isEncrypted(R, P))
+ {
+ if (R < 3)
+ {
+ status = is_bit_set(P, 4);
+ }
+ else
+ {
+ status = is_bit_set(P, 11);
+ }
+ }
+ return status;
+}
+
+DLL_EXPORT
+bool
+QPDF::allowModifyForm()
+{
+ int R = 0;
+ int P = 0;
+ bool status = true;
+ if (isEncrypted(R, P))
+ {
+ if (R < 3)
+ {
+ status = is_bit_set(P, 6);
+ }
+ else
+ {
+ status = is_bit_set(P, 9);
+ }
+ }
+ return status;
+}
+
+DLL_EXPORT
+bool
+QPDF::allowModifyAnnotation()
+{
+ int R = 0;
+ int P = 0;
+ bool status = true;
+ if (isEncrypted(R, P))
+ {
+ status = is_bit_set(P, 6);
+ }
+ return status;
+}
+
+DLL_EXPORT
+bool
+QPDF::allowModifyOther()
+{
+ int R = 0;
+ int P = 0;
+ bool status = true;
+ if (isEncrypted(R, P))
+ {
+ status = is_bit_set(P, 4);
+ }
+ return status;
+}
+
+DLL_EXPORT
+bool
+QPDF::allowModifyAll()
+{
+ int R = 0;
+ int P = 0;
+ bool status = true;
+ if (isEncrypted(R, P))
+ {
+ status = (is_bit_set(P, 4) && is_bit_set(P, 6));
+ if (R >= 3)
+ {
+ status = status && (is_bit_set(P, 9) && is_bit_set(P, 11));
+ }
+ }
+ return status;
+}
diff --git a/libqpdf/qpdf-c.cc b/libqpdf/qpdf-c.cc
index d7f8d40f..5f894895 100644
--- a/libqpdf/qpdf-c.cc
+++ b/libqpdf/qpdf-c.cc
@@ -186,6 +186,69 @@ QPDF_BOOL qpdf_is_encrypted(qpdf_data qpdf)
}
DLL_EXPORT
+QPDF_BOOL qpdf_allow_accessibility(qpdf_data qpdf)
+{
+ QTC::TC("qpdf", "qpdf-c called qpdf_allow_accessibility");
+ return qpdf->qpdf->allowAccessibility();
+}
+
+DLL_EXPORT
+QPDF_BOOL qpdf_allow_extract_all(qpdf_data qpdf)
+{
+ QTC::TC("qpdf", "qpdf-c called qpdf_allow_extract_all");
+ return qpdf->qpdf->allowExtractAll();
+}
+
+DLL_EXPORT
+QPDF_BOOL qpdf_allow_print_low_res(qpdf_data qpdf)
+{
+ QTC::TC("qpdf", "qpdf-c called qpdf_allow_print_low_res");
+ return qpdf->qpdf->allowPrintLowRes();
+}
+
+DLL_EXPORT
+QPDF_BOOL qpdf_allow_print_high_res(qpdf_data qpdf)
+{
+ QTC::TC("qpdf", "qpdf-c called qpdf_allow_print_high_res");
+ return qpdf->qpdf->allowPrintHighRes();
+}
+
+DLL_EXPORT
+QPDF_BOOL qpdf_allow_modify_assembly(qpdf_data qpdf)
+{
+ QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_assembly");
+ return qpdf->qpdf->allowModifyAssembly();
+}
+
+DLL_EXPORT
+QPDF_BOOL qpdf_allow_modify_form(qpdf_data qpdf)
+{
+ QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_form");
+ return qpdf->qpdf->allowModifyForm();
+}
+
+DLL_EXPORT
+QPDF_BOOL qpdf_allow_modify_annotation(qpdf_data qpdf)
+{
+ QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_annotation");
+ return qpdf->qpdf->allowModifyAnnotation();
+}
+
+DLL_EXPORT
+QPDF_BOOL qpdf_allow_modify_other(qpdf_data qpdf)
+{
+ QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_other");
+ return qpdf->qpdf->allowModifyOther();
+}
+
+DLL_EXPORT
+QPDF_BOOL qpdf_allow_modify_all(qpdf_data qpdf)
+{
+ QTC::TC("qpdf", "qpdf-c called qpdf_allow_modify_all");
+ return qpdf->qpdf->allowModifyAll();
+}
+
+DLL_EXPORT
QPDF_ERROR_CODE qpdf_init_write(qpdf_data qpdf, char const* filename)
{
QPDF_ERROR_CODE status = QPDF_SUCCESS;
diff --git a/qpdf/qpdf-ctest.c b/qpdf/qpdf-ctest.c
index 6a4bc2a9..456f06c6 100644
--- a/qpdf/qpdf-ctest.c
+++ b/qpdf/qpdf-ctest.c
@@ -29,6 +29,24 @@ static void test01(char const* infile,
if (qpdf_is_encrypted(qpdf))
{
printf("user password: %s\n", qpdf_get_user_password(qpdf));
+ printf("extract for accessibility: %d\n",
+ qpdf_allow_accessibility(qpdf));
+ printf("extract for any purpose: %d\n",
+ qpdf_allow_extract_all(qpdf));
+ printf("print low resolution: %d\n",
+ qpdf_allow_print_low_res(qpdf));
+ printf("print high resolution: %d\n",
+ qpdf_allow_print_high_res(qpdf));
+ printf("modify document assembly: %d\n",
+ qpdf_allow_modify_assembly(qpdf));
+ printf("modify forms: %d\n",
+ qpdf_allow_modify_form(qpdf));
+ printf("modify annotations: %d\n",
+ qpdf_allow_modify_annotation(qpdf));
+ printf("modify other: %d\n",
+ qpdf_allow_modify_other(qpdf));
+ printf("modify anything: %d\n",
+ qpdf_allow_modify_all(qpdf));
}
report_errors();
}
diff --git a/qpdf/qpdf.cc b/qpdf/qpdf.cc
index 451cdeb6..9cd0df7b 100644
--- a/qpdf/qpdf.cc
+++ b/qpdf/qpdf.cc
@@ -165,21 +165,44 @@ void usage(std::string const& msg)
exit(EXIT_ERROR);
}
+static std::string show_bool(bool v)
+{
+ return v ? "allowed" : "not allowed";
+}
+
static void show_encryption(QPDF& pdf)
{
// Extract /P from /Encrypt
- if (! pdf.isEncrypted())
+ int R = 0;
+ int P = 0;
+ if (! pdf.isEncrypted(R, P))
{
std::cout << "File is not encrypted" << std::endl;
}
else
{
- QPDFObjectHandle trailer = pdf.getTrailer();
- QPDFObjectHandle encrypt = trailer.getKey("/Encrypt");
- QPDFObjectHandle P = encrypt.getKey("/P");
- std::cout << "P = " << P.getIntValue() << std::endl;
+ std::cout << "R = " << R << std::endl;
+ std::cout << "P = " << P << std::endl;
std::string user_password = pdf.getTrimmedUserPassword();
std::cout << "User password = " << user_password << std::endl;
+ std::cout << "extract for accessibility: "
+ << show_bool(pdf.allowAccessibility()) << std::endl;
+ std::cout << "extract for any purpose: "
+ << show_bool(pdf.allowExtractAll()) << std::endl;
+ std::cout << "print low resolution: "
+ << show_bool(pdf.allowPrintLowRes()) << std::endl;
+ std::cout << "print high resolution: "
+ << show_bool(pdf.allowPrintHighRes()) << std::endl;
+ std::cout << "modify document assembly: "
+ << show_bool(pdf.allowModifyAssembly()) << std::endl;
+ std::cout << "modify forms: "
+ << show_bool(pdf.allowModifyForm()) << std::endl;
+ std::cout << "modify annotations: "
+ << show_bool(pdf.allowModifyAnnotation()) << std::endl;
+ std::cout << "modify other: "
+ << show_bool(pdf.allowModifyOther()) << std::endl;
+ std::cout << "modify anything: "
+ << show_bool(pdf.allowModifyAll()) << std::endl;
}
}
diff --git a/qpdf/qpdf.testcov b/qpdf/qpdf.testcov
index c0ca04a1..cf4dc333 100644
--- a/qpdf/qpdf.testcov
+++ b/qpdf/qpdf.testcov
@@ -144,3 +144,12 @@ qpdf-c called qpdf_set_r2_encryption_parameters 0
qpdf-c called qpdf_set_r3_encryption_parameters 0
qpdf-c called qpdf_set_linearization 0
qpdf-c called qpdf_write 3
+qpdf-c called qpdf_allow_accessibility 0
+qpdf-c called qpdf_allow_extract_all 0
+qpdf-c called qpdf_allow_print_low_res 0
+qpdf-c called qpdf_allow_print_high_res 0
+qpdf-c called qpdf_allow_modify_assembly 0
+qpdf-c called qpdf_allow_modify_form 0
+qpdf-c called qpdf_allow_modify_annotation 0
+qpdf-c called qpdf_allow_modify_other 0
+qpdf-c called qpdf_allow_modify_all 0
diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test
index 73f6dae1..70021676 100644
--- a/qpdf/qtest/qpdf.test
+++ b/qpdf/qtest/qpdf.test
@@ -683,33 +683,48 @@ $td->notify("--- Encryption Tests ---");
# resulting files were saved and manually checked with Acrobat 5.0 to
# ensure that the security settings were as intended.
-# Values: basename, password, encryption flags, /P Encrypt key.
+# Values: basename, password, encryption flags, /P Encrypt key,
+# extract-for-accessibility, extract-for-any-purpose,
+# print-low-res, print-high-res, modify-assembly, modify-forms,
+# modify-annotate, modify-other, modify-all
my @encrypted_files =
(['base', ''],
['R3,V2', '',
- '-accessibility=n -extract=n -print=full -modify=all', -532],
+ '-accessibility=n -extract=n -print=full -modify=all', -532,
+ 0, 0, 1, 1, 1, 1, 1, 1, 1],
['R3,V2,U=view', 'view',
- '-accessibility=y -extract=n -print=none -modify=none', -3392],
+ '-accessibility=y -extract=n -print=none -modify=none', -3392,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0],
['R3,V2,O=master', 'master',
- '-accessibility=n -extract=y -print=none -modify=annotate', -2576],
+ '-accessibility=n -extract=y -print=none -modify=annotate', -2576,
+ 0, 1, 0, 0, 1, 1, 1, 0, 0],
['R3,V2,O=master', '',
- '-accessibility=n -extract=n -print=none -modify=form', -2624],
+ '-accessibility=n -extract=n -print=none -modify=form', -2624,
+ 0, 0, 0, 0, 1, 1, 0, 0, 0],
['R3,V2,U=view,O=master', 'view',
- '-accessibility=n -extract=n -print=none -modify=assembly', -2880],
+ '-accessibility=n -extract=n -print=none -modify=assembly', -2880,
+ 0, 0, 0, 0, 1, 0, 0, 0, 0],
['R3,V2,U=view,O=master', 'master',
- '-accessibility=n -print=low', -2564],
+ '-accessibility=n -print=low', -2564,
+ 0, 1, 1, 0, 1, 1, 1, 1, 1],
['R2,V1', '',
- '-print=n -modify=n -extract=n -annotate=n', -64],
+ '-print=n -modify=n -extract=n -annotate=n', -64,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0],
['R2,V1,U=view', 'view',
- '-print=y -modify=n -extract=n -annotate=n', -60],
+ '-print=y -modify=n -extract=n -annotate=n', -60,
+ 0, 0, 1, 1, 0, 0, 0, 0, 0],
['R2,V1,O=master', 'master',
- '-print=n -modify=y -extract=n -annotate=n', -56],
+ '-print=n -modify=y -extract=n -annotate=n', -56,
+ 0, 0, 0, 0, 1, 0, 0, 1, 0],
['R2,V1,O=master', '',
- '-print=n -modify=n -extract=y -annotate=n', -48],
+ '-print=n -modify=n -extract=y -annotate=n', -48,
+ 1, 1, 0, 0, 0, 0, 0, 0, 0],
['R2,V1,U=view,O=master', 'view',
- '-print=n -modify=n -extract=n -annotate=y', -32],
+ '-print=n -modify=n -extract=n -annotate=y', -32,
+ 0, 0, 0, 0, 0, 1, 1, 0, 0],
['R2,V1,U=view,O=master', 'master',
- '', -4],
+ '', -4,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1],
['long-password', 'asdf asdf asdf asdf asdf asdf qwer'],
['long-password', 'asdf asdf asdf asdf asdf asdf qw']);
@@ -732,7 +747,23 @@ $td->runtest("recheck encrypted file",
foreach my $d (@encrypted_files)
{
- my ($file, $pass, $xeflags, $P) = @$d;
+ my ($file, $pass, $xeflags, $P,
+ $accessible, $extract, $printlow, $printhigh,
+ $modifyassembly, $modifyform, $modifyannot,
+ $modifyother, $modifyall) = @$d;
+
+ my $f = sub { $_[0] ? "allowed" : "not allowed" };
+ my $enc_details =
+ "extract for accessibility: " . &$f($accessible) . "\n" .
+ "extract for any purpose: " . &$f($extract) . "\n" .
+ "print low resolution: " . &$f($printlow) . "\n" .
+ "print high resolution: " . &$f($printhigh) . "\n" .
+ "modify document assembly: " . &$f($modifyassembly) . "\n" .
+ "modify forms: " . &$f($modifyform) . "\n" .
+ "modify annotations: " . &$f($modifyannot) . "\n" .
+ "modify other: " . &$f($modifyother) . "\n" .
+ "modify anything: " . &$f($modifyall) . "\n";
+
# Test writing to stdout
$td->runtest("decrypt $file",
{$td->COMMAND =>
@@ -776,8 +807,9 @@ foreach my $d (@encrypted_files)
{$td->COMMAND =>
"qpdf --show-encryption --password=\"$pass\"" .
" $file.enc2"},
- {$td->STRING => "P = $P\nUser password = $upass\n",
- $td->EXIT_STATUS => 0},
+ {$td->STRING => "R = $R\nP = $P\n" .
+ "User password = $upass\n$enc_details",
+ $td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
$td->runtest("decrypt again",
{$td->COMMAND =>
@@ -799,8 +831,9 @@ foreach my $d (@encrypted_files)
{$td->COMMAND =>
"qpdf --show-encryption --password=\"$pass\"" .
" $file.enc4"},
- {$td->STRING => "P = $P\nUser password = $upass\n",
- $td->EXIT_STATUS => 0},
+ {$td->STRING => "R = $R\nP = $P\n" .
+ "User password = $upass\n$enc_details",
+ $td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
}
}
@@ -828,8 +861,9 @@ $td->runtest("linearize encrypted file",
{$td->STRING => "",
$td->EXIT_STATUS => 0});
$td->runtest("check encryption",
- {$td->COMMAND => "qpdf --show-encryption a.pdf"},
- {$td->STRING => "P = -60\nUser password = \n",
+ {$td->COMMAND => "qpdf --show-encryption a.pdf",
+ $td->FILTER => "grep -v allowed"},
+ {$td->STRING => "R = 2\nP = -60\nUser password = \n",
$td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
$td->runtest("check linearization",
@@ -844,8 +878,9 @@ $td->runtest("linearize and encrypt file",
{$td->STRING => "",
$td->EXIT_STATUS => 0});
$td->runtest("check encryption",
- {$td->COMMAND => "qpdf --show-encryption --password=owner a.pdf"},
- {$td->STRING => "P = -4\nUser password = user\n",
+ {$td->COMMAND => "qpdf --show-encryption --password=owner a.pdf",
+ $td->FILTER => "grep -v allowed"},
+ {$td->STRING => "R = 3\nP = -4\nUser password = user\n",
$td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
$td->runtest("check linearization",
diff --git a/qpdf/qtest/qpdf/U25A0.10-ogen.c-check b/qpdf/qtest/qpdf/U25A0.10-ogen.c-check
index d0e2e2aa..963cdba4 100644
--- a/qpdf/qtest/qpdf/U25A0.10-ogen.c-check
+++ b/qpdf/qtest/qpdf/U25A0.10-ogen.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 0
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/U25A0.10-ogen.check b/qpdf/qtest/qpdf/U25A0.10-ogen.check
index fa130173..fba29c61 100644
--- a/qpdf/qtest/qpdf/U25A0.10-ogen.check
+++ b/qpdf/qtest/qpdf/U25A0.10-ogen.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is not linearized
No errors found
diff --git a/qpdf/qtest/qpdf/U25A0.10.c-check b/qpdf/qtest/qpdf/U25A0.10.c-check
index 7d98e913..628b5fac 100644
--- a/qpdf/qtest/qpdf/U25A0.10.c-check
+++ b/qpdf/qtest/qpdf/U25A0.10.c-check
@@ -2,3 +2,12 @@ version: 1.4
linearized: 0
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/U25A0.10.check b/qpdf/qtest/qpdf/U25A0.10.check
index 390434bc..8d3b2593 100644
--- a/qpdf/qtest/qpdf/U25A0.10.check
+++ b/qpdf/qtest/qpdf/U25A0.10.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.4
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is not linearized
No errors found
diff --git a/qpdf/qtest/qpdf/U25A0.11-ogen.c-check b/qpdf/qtest/qpdf/U25A0.11-ogen.c-check
index d21a7d2d..ef82b7f0 100644
--- a/qpdf/qtest/qpdf/U25A0.11-ogen.c-check
+++ b/qpdf/qtest/qpdf/U25A0.11-ogen.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 1
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/U25A0.11-ogen.check b/qpdf/qtest/qpdf/U25A0.11-ogen.check
index c31b668c..fcb16c0d 100644
--- a/qpdf/qtest/qpdf/U25A0.11-ogen.check
+++ b/qpdf/qtest/qpdf/U25A0.11-ogen.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is linearized
No errors found
diff --git a/qpdf/qtest/qpdf/U25A0.11.c-check b/qpdf/qtest/qpdf/U25A0.11.c-check
index ac26e200..a528204e 100644
--- a/qpdf/qtest/qpdf/U25A0.11.c-check
+++ b/qpdf/qtest/qpdf/U25A0.11.c-check
@@ -2,3 +2,12 @@ version: 1.4
linearized: 1
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/U25A0.11.check b/qpdf/qtest/qpdf/U25A0.11.check
index e233cd3b..41fbca19 100644
--- a/qpdf/qtest/qpdf/U25A0.11.check
+++ b/qpdf/qtest/qpdf/U25A0.11.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.4
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is linearized
No errors found
diff --git a/qpdf/qtest/qpdf/U25A0.12-ogen.c-check b/qpdf/qtest/qpdf/U25A0.12-ogen.c-check
index d0e2e2aa..11d6d63d 100644
--- a/qpdf/qtest/qpdf/U25A0.12-ogen.c-check
+++ b/qpdf/qtest/qpdf/U25A0.12-ogen.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 0
encrypted: 1
user password:
+extract for accessibility: 0
+extract for any purpose: 0
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 0
+modify forms: 0
+modify annotations: 0
+modify other: 0
+modify anything: 0
diff --git a/qpdf/qtest/qpdf/U25A0.12-ogen.check b/qpdf/qtest/qpdf/U25A0.12-ogen.check
index 64d811d5..9e99897f 100644
--- a/qpdf/qtest/qpdf/U25A0.12-ogen.check
+++ b/qpdf/qtest/qpdf/U25A0.12-ogen.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 2
P = -60
User password =
+extract for accessibility: not allowed
+extract for any purpose: not allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: not allowed
+modify forms: not allowed
+modify annotations: not allowed
+modify other: not allowed
+modify anything: not allowed
File is not linearized
No errors found
diff --git a/qpdf/qtest/qpdf/U25A0.12.c-check b/qpdf/qtest/qpdf/U25A0.12.c-check
index 6ba46805..b37fa759 100644
--- a/qpdf/qtest/qpdf/U25A0.12.c-check
+++ b/qpdf/qtest/qpdf/U25A0.12.c-check
@@ -2,3 +2,12 @@ version: 1.3
linearized: 0
encrypted: 1
user password:
+extract for accessibility: 0
+extract for any purpose: 0
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 0
+modify forms: 0
+modify annotations: 0
+modify other: 0
+modify anything: 0
diff --git a/qpdf/qtest/qpdf/U25A0.12.check b/qpdf/qtest/qpdf/U25A0.12.check
index 9b269b15..13c514f1 100644
--- a/qpdf/qtest/qpdf/U25A0.12.check
+++ b/qpdf/qtest/qpdf/U25A0.12.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.3
+R = 2
P = -60
User password =
+extract for accessibility: not allowed
+extract for any purpose: not allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: not allowed
+modify forms: not allowed
+modify annotations: not allowed
+modify other: not allowed
+modify anything: not allowed
File is not linearized
No errors found
diff --git a/qpdf/qtest/qpdf/U25A0.9-ogen.c-check b/qpdf/qtest/qpdf/U25A0.9-ogen.c-check
index d21a7d2d..cc892af7 100644
--- a/qpdf/qtest/qpdf/U25A0.9-ogen.c-check
+++ b/qpdf/qtest/qpdf/U25A0.9-ogen.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 1
encrypted: 1
user password:
+extract for accessibility: 0
+extract for any purpose: 0
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 0
+modify forms: 0
+modify annotations: 0
+modify other: 0
+modify anything: 0
diff --git a/qpdf/qtest/qpdf/U25A0.9-ogen.check b/qpdf/qtest/qpdf/U25A0.9-ogen.check
index 5bc7ceb7..ea3b33b0 100644
--- a/qpdf/qtest/qpdf/U25A0.9-ogen.check
+++ b/qpdf/qtest/qpdf/U25A0.9-ogen.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 2
P = -60
User password =
+extract for accessibility: not allowed
+extract for any purpose: not allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: not allowed
+modify forms: not allowed
+modify annotations: not allowed
+modify other: not allowed
+modify anything: not allowed
File is linearized
No errors found
diff --git a/qpdf/qtest/qpdf/U25A0.9.c-check b/qpdf/qtest/qpdf/U25A0.9.c-check
index 345b56d8..18ee32d3 100644
--- a/qpdf/qtest/qpdf/U25A0.9.c-check
+++ b/qpdf/qtest/qpdf/U25A0.9.c-check
@@ -2,3 +2,12 @@ version: 1.3
linearized: 1
encrypted: 1
user password:
+extract for accessibility: 0
+extract for any purpose: 0
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 0
+modify forms: 0
+modify annotations: 0
+modify other: 0
+modify anything: 0
diff --git a/qpdf/qtest/qpdf/U25A0.9.check b/qpdf/qtest/qpdf/U25A0.9.check
index e45e12d6..70f8bf3c 100644
--- a/qpdf/qtest/qpdf/U25A0.9.check
+++ b/qpdf/qtest/qpdf/U25A0.9.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.3
+R = 2
P = -60
User password =
+extract for accessibility: not allowed
+extract for any purpose: not allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: not allowed
+modify forms: not allowed
+modify annotations: not allowed
+modify other: not allowed
+modify anything: not allowed
File is linearized
No errors found
diff --git a/qpdf/qtest/qpdf/hybrid-xref.10-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.10-ogen.c-check
index d0e2e2aa..963cdba4 100644
--- a/qpdf/qtest/qpdf/hybrid-xref.10-ogen.c-check
+++ b/qpdf/qtest/qpdf/hybrid-xref.10-ogen.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 0
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/hybrid-xref.10-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.10-ogen.check
index fa130173..fba29c61 100644
--- a/qpdf/qtest/qpdf/hybrid-xref.10-ogen.check
+++ b/qpdf/qtest/qpdf/hybrid-xref.10-ogen.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is not linearized
No errors found
diff --git a/qpdf/qtest/qpdf/hybrid-xref.10.c-check b/qpdf/qtest/qpdf/hybrid-xref.10.c-check
index d0e2e2aa..963cdba4 100644
--- a/qpdf/qtest/qpdf/hybrid-xref.10.c-check
+++ b/qpdf/qtest/qpdf/hybrid-xref.10.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 0
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/hybrid-xref.10.check b/qpdf/qtest/qpdf/hybrid-xref.10.check
index fa130173..fba29c61 100644
--- a/qpdf/qtest/qpdf/hybrid-xref.10.check
+++ b/qpdf/qtest/qpdf/hybrid-xref.10.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is not linearized
No errors found
diff --git a/qpdf/qtest/qpdf/hybrid-xref.11-ogen.c-check b/qpdf/qtest/qpdf/hybrid-xref.11-ogen.c-check
index d21a7d2d..ef82b7f0 100644
--- a/qpdf/qtest/qpdf/hybrid-xref.11-ogen.c-check
+++ b/qpdf/qtest/qpdf/hybrid-xref.11-ogen.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 1
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/hybrid-xref.11-ogen.check b/qpdf/qtest/qpdf/hybrid-xref.11-ogen.check
index c31b668c..fcb16c0d 100644
--- a/qpdf/qtest/qpdf/hybrid-xref.11-ogen.check
+++ b/qpdf/qtest/qpdf/hybrid-xref.11-ogen.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is linearized
No errors found
diff --git a/qpdf/qtest/qpdf/hybrid-xref.11.c-check b/qpdf/qtest/qpdf/hybrid-xref.11.c-check
index d21a7d2d..ef82b7f0 100644
--- a/qpdf/qtest/qpdf/hybrid-xref.11.c-check
+++ b/qpdf/qtest/qpdf/hybrid-xref.11.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 1
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/hybrid-xref.11.check b/qpdf/qtest/qpdf/hybrid-xref.11.check
index c31b668c..fcb16c0d 100644
--- a/qpdf/qtest/qpdf/hybrid-xref.11.check
+++ b/qpdf/qtest/qpdf/hybrid-xref.11.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is linearized
No errors found
diff --git a/qpdf/qtest/qpdf/inline-images.10-ogen.c-check b/qpdf/qtest/qpdf/inline-images.10-ogen.c-check
index d0e2e2aa..963cdba4 100644
--- a/qpdf/qtest/qpdf/inline-images.10-ogen.c-check
+++ b/qpdf/qtest/qpdf/inline-images.10-ogen.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 0
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/inline-images.10-ogen.check b/qpdf/qtest/qpdf/inline-images.10-ogen.check
index fa130173..fba29c61 100644
--- a/qpdf/qtest/qpdf/inline-images.10-ogen.check
+++ b/qpdf/qtest/qpdf/inline-images.10-ogen.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is not linearized
No errors found
diff --git a/qpdf/qtest/qpdf/inline-images.10.c-check b/qpdf/qtest/qpdf/inline-images.10.c-check
index 7d98e913..628b5fac 100644
--- a/qpdf/qtest/qpdf/inline-images.10.c-check
+++ b/qpdf/qtest/qpdf/inline-images.10.c-check
@@ -2,3 +2,12 @@ version: 1.4
linearized: 0
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/inline-images.10.check b/qpdf/qtest/qpdf/inline-images.10.check
index 390434bc..8d3b2593 100644
--- a/qpdf/qtest/qpdf/inline-images.10.check
+++ b/qpdf/qtest/qpdf/inline-images.10.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.4
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is not linearized
No errors found
diff --git a/qpdf/qtest/qpdf/inline-images.11-ogen.c-check b/qpdf/qtest/qpdf/inline-images.11-ogen.c-check
index d21a7d2d..ef82b7f0 100644
--- a/qpdf/qtest/qpdf/inline-images.11-ogen.c-check
+++ b/qpdf/qtest/qpdf/inline-images.11-ogen.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 1
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/inline-images.11-ogen.check b/qpdf/qtest/qpdf/inline-images.11-ogen.check
index c31b668c..fcb16c0d 100644
--- a/qpdf/qtest/qpdf/inline-images.11-ogen.check
+++ b/qpdf/qtest/qpdf/inline-images.11-ogen.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is linearized
No errors found
diff --git a/qpdf/qtest/qpdf/inline-images.11.c-check b/qpdf/qtest/qpdf/inline-images.11.c-check
index ac26e200..a528204e 100644
--- a/qpdf/qtest/qpdf/inline-images.11.c-check
+++ b/qpdf/qtest/qpdf/inline-images.11.c-check
@@ -2,3 +2,12 @@ version: 1.4
linearized: 1
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/inline-images.11.check b/qpdf/qtest/qpdf/inline-images.11.check
index e233cd3b..41fbca19 100644
--- a/qpdf/qtest/qpdf/inline-images.11.check
+++ b/qpdf/qtest/qpdf/inline-images.11.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.4
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is linearized
No errors found
diff --git a/qpdf/qtest/qpdf/lin-special.10-ogen.c-check b/qpdf/qtest/qpdf/lin-special.10-ogen.c-check
index d0e2e2aa..963cdba4 100644
--- a/qpdf/qtest/qpdf/lin-special.10-ogen.c-check
+++ b/qpdf/qtest/qpdf/lin-special.10-ogen.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 0
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/lin-special.10-ogen.check b/qpdf/qtest/qpdf/lin-special.10-ogen.check
index fa130173..fba29c61 100644
--- a/qpdf/qtest/qpdf/lin-special.10-ogen.check
+++ b/qpdf/qtest/qpdf/lin-special.10-ogen.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is not linearized
No errors found
diff --git a/qpdf/qtest/qpdf/lin-special.10.c-check b/qpdf/qtest/qpdf/lin-special.10.c-check
index 7d98e913..628b5fac 100644
--- a/qpdf/qtest/qpdf/lin-special.10.c-check
+++ b/qpdf/qtest/qpdf/lin-special.10.c-check
@@ -2,3 +2,12 @@ version: 1.4
linearized: 0
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/lin-special.10.check b/qpdf/qtest/qpdf/lin-special.10.check
index 390434bc..8d3b2593 100644
--- a/qpdf/qtest/qpdf/lin-special.10.check
+++ b/qpdf/qtest/qpdf/lin-special.10.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.4
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is not linearized
No errors found
diff --git a/qpdf/qtest/qpdf/lin-special.11-ogen.c-check b/qpdf/qtest/qpdf/lin-special.11-ogen.c-check
index d21a7d2d..ef82b7f0 100644
--- a/qpdf/qtest/qpdf/lin-special.11-ogen.c-check
+++ b/qpdf/qtest/qpdf/lin-special.11-ogen.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 1
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/lin-special.11-ogen.check b/qpdf/qtest/qpdf/lin-special.11-ogen.check
index c31b668c..fcb16c0d 100644
--- a/qpdf/qtest/qpdf/lin-special.11-ogen.check
+++ b/qpdf/qtest/qpdf/lin-special.11-ogen.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is linearized
No errors found
diff --git a/qpdf/qtest/qpdf/lin-special.11.c-check b/qpdf/qtest/qpdf/lin-special.11.c-check
index ac26e200..a528204e 100644
--- a/qpdf/qtest/qpdf/lin-special.11.c-check
+++ b/qpdf/qtest/qpdf/lin-special.11.c-check
@@ -2,3 +2,12 @@ version: 1.4
linearized: 1
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/lin-special.11.check b/qpdf/qtest/qpdf/lin-special.11.check
index e233cd3b..41fbca19 100644
--- a/qpdf/qtest/qpdf/lin-special.11.check
+++ b/qpdf/qtest/qpdf/lin-special.11.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.4
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is linearized
No errors found
diff --git a/qpdf/qtest/qpdf/object-stream.10-ogen.c-check b/qpdf/qtest/qpdf/object-stream.10-ogen.c-check
index d0e2e2aa..963cdba4 100644
--- a/qpdf/qtest/qpdf/object-stream.10-ogen.c-check
+++ b/qpdf/qtest/qpdf/object-stream.10-ogen.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 0
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/object-stream.10-ogen.check b/qpdf/qtest/qpdf/object-stream.10-ogen.check
index fa130173..fba29c61 100644
--- a/qpdf/qtest/qpdf/object-stream.10-ogen.check
+++ b/qpdf/qtest/qpdf/object-stream.10-ogen.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is not linearized
No errors found
diff --git a/qpdf/qtest/qpdf/object-stream.10.c-check b/qpdf/qtest/qpdf/object-stream.10.c-check
index d0e2e2aa..963cdba4 100644
--- a/qpdf/qtest/qpdf/object-stream.10.c-check
+++ b/qpdf/qtest/qpdf/object-stream.10.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 0
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/object-stream.10.check b/qpdf/qtest/qpdf/object-stream.10.check
index fa130173..fba29c61 100644
--- a/qpdf/qtest/qpdf/object-stream.10.check
+++ b/qpdf/qtest/qpdf/object-stream.10.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is not linearized
No errors found
diff --git a/qpdf/qtest/qpdf/object-stream.11-ogen.c-check b/qpdf/qtest/qpdf/object-stream.11-ogen.c-check
index d21a7d2d..ef82b7f0 100644
--- a/qpdf/qtest/qpdf/object-stream.11-ogen.c-check
+++ b/qpdf/qtest/qpdf/object-stream.11-ogen.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 1
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/object-stream.11-ogen.check b/qpdf/qtest/qpdf/object-stream.11-ogen.check
index c31b668c..fcb16c0d 100644
--- a/qpdf/qtest/qpdf/object-stream.11-ogen.check
+++ b/qpdf/qtest/qpdf/object-stream.11-ogen.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is linearized
No errors found
diff --git a/qpdf/qtest/qpdf/object-stream.11.c-check b/qpdf/qtest/qpdf/object-stream.11.c-check
index d21a7d2d..ef82b7f0 100644
--- a/qpdf/qtest/qpdf/object-stream.11.c-check
+++ b/qpdf/qtest/qpdf/object-stream.11.c-check
@@ -2,3 +2,12 @@ version: 1.5
linearized: 1
encrypted: 1
user password:
+extract for accessibility: 1
+extract for any purpose: 1
+print low resolution: 1
+print high resolution: 1
+modify document assembly: 1
+modify forms: 1
+modify annotations: 1
+modify other: 1
+modify anything: 1
diff --git a/qpdf/qtest/qpdf/object-stream.11.check b/qpdf/qtest/qpdf/object-stream.11.check
index c31b668c..fcb16c0d 100644
--- a/qpdf/qtest/qpdf/object-stream.11.check
+++ b/qpdf/qtest/qpdf/object-stream.11.check
@@ -1,6 +1,16 @@
checking a.pdf
PDF Version: 1.5
+R = 3
P = -4
User password =
+extract for accessibility: allowed
+extract for any purpose: allowed
+print low resolution: allowed
+print high resolution: allowed
+modify document assembly: allowed
+modify forms: allowed
+modify annotations: allowed
+modify other: allowed
+modify anything: allowed
File is linearized
No errors found