2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-26 07:12:45 +00:00
Commit Graph

943 Commits

Author SHA1 Message Date
Jay Berkenbilt
2994f9cf4c Attempt to find xref streams during recovery (fixes #1103) 2024-01-06 16:51:03 -05:00
Jay Berkenbilt
7cac433e2d Implement --set-page-labels and supporting API (fixes #939) 2024-01-05 17:12:12 -05:00
Jay Berkenbilt
a0e70b370a Wiring for --set-page-labels: manual (non-bisectable commit)
This commit contains only the manual changes. It is separated for
clarity. This commit would not pass CI because it lacks the automated
changes, which appear in the next commit.
2024-01-05 17:10:32 -05:00
Jay Berkenbilt
d8d70ecca2 Support comma-separated numeric values with --collate (fixes #505) 2024-01-01 18:57:32 -05:00
Jay Berkenbilt
78a7193fe2 Preserve annotations that inherently lack appearance (fixes #1039)
...when flattening annotations. This includes /Link, /Popup,
and /Projection.
2023-12-29 13:40:08 -05:00
Jay Berkenbilt
a3b939ce58 Tweak utf8 checks 2023-12-27 10:48:54 -05:00
Jay Berkenbilt
f5a1e2872e Add overlong UTF-8 bytes into JSON tests 2023-12-25 11:17:17 -05:00
Jay Berkenbilt
4ca185fd96 Remove --disable-signatures; incorporate into --remove-restrictions
Rather than adding yet another flag that is almost never useful on its
own, just have --remove-restrictions disable digital signatures. The
operations are still separate in the API.
2023-12-24 07:36:07 -05:00
Jay Berkenbilt
7c0fdf8510 Format code, bump clang-format version to 18 2023-12-22 21:45:10 -05:00
Jay Berkenbilt
1f45686843 Handle --encrypt -- without crashing 2023-12-22 20:10:21 -05:00
Jay Berkenbilt
a2c4a2b12a Arbitrarily use new --encrypt syntax for some tests
Now the tests intermix old and new syntax, ensuring both are
exercised.
2023-12-22 20:10:21 -05:00
Jay Berkenbilt
7d7e2234a5 Implement new --encrypt args and completion (fixes #784)
Positional arguments are supported in a backward-compatible way, but
completion no longer guides users to it.
2023-12-22 20:10:18 -05:00
Jay Berkenbilt
b670565abc Convert scientific notation in JSON to fixed point (fixes #1079)
JSON accepts scientific notation, but PDF doesn't.
2023-12-21 17:56:30 -05:00
Jay Berkenbilt
4400ce84ee Add "n:/pdf-name" to qpdf JSON for binary names (fixes #1072) 2023-12-21 17:43:29 -05:00
Jay Berkenbilt
b8fd18ae56 Merge branch 'parse_ref' into work 2023-12-21 15:43:50 -05:00
Jay Berkenbilt
4ee393d1fa Remove compression from linearization tests where possible
By combining --linearize with --compress-streams=n, we ensure that no
new compressed data will appear in linearized output, which makes the
output independent of zlib's output. There are other tests to ensure
that linearization works correctly with compression. This commit
involves changing some test outputs and test code as well just
updating test suites.
2023-12-20 15:46:20 -05:00
Jay Berkenbilt
7e679ab8b6 Avoid depending on exact xref stream offsets
For the modified test case, we care about successful recovery, not
about the exact offsets. Add a filter to remove the specific numbers
from show-xref.
2023-12-20 15:46:20 -05:00
Jay Berkenbilt
d61612a2e5 Bug fix: don't compress hint streams when --compress-streams=n 2023-12-20 15:46:20 -05:00
Jay Berkenbilt
c5f622a09e Bug fix: don't compress object/xref streams with --compress-streams=n 2023-12-20 15:46:20 -05:00
Jay Berkenbilt
4c3c658e25 Fix tests with password-protected files 2023-12-20 15:46:20 -05:00
Jay Berkenbilt
321f9e79db Fix tests with deterministic IDs 2023-12-20 15:46:20 -05:00
Jay Berkenbilt
a238b4b0fd Ensure there is a meaningful deterministic ID test
If we ignore /ID[1], we need to make sure deterministic IDs are
tested properly.
2023-12-20 15:21:32 -05:00
Jay Berkenbilt
c67634afa0 Fix tests when running comparison tool is adequate
Fix all tests where the only required fix is to run qpdf-test-compare
instead of doing a simple file comparison.
2023-12-20 15:21:32 -05:00
m-holger
9146f1f0fd Change default for SF_FlateLzwDecode::columns to 1 2023-11-23 01:51:38 +00:00
m-holger
605b1429e8 In QPDFParser::parse create dictionaries on the fly
Also, don't search for /Contents name unless the result is used.
2023-11-03 11:09:58 +00:00
m-holger
0328d87237 In QPDFParser::parse refactor parsing of indirect references 2023-11-03 01:34:16 +00:00
m-holger
172cc61305 Remove redundant code in QPDFParser::parse and parseRemainder
Also, fix test cases.
2023-11-03 01:26:34 +00:00
m-holger
26e0bf4610 In QPDFParser::parse refactor eof handling 2023-11-01 15:23:30 +00:00
Jay Berkenbilt
9fc02e2f91 Add another string parsing test 2023-10-14 17:31:54 -04:00
Jay Berkenbilt
1ecc6bb29e Don't lose character after \d or \dd parsing string (fixes #1050) 2023-10-14 17:12:56 -04:00
m-holger
fb504ce913 Fix #1028 2023-09-05 17:22:34 +01:00
Jay Berkenbilt
dc863a10b2 Change test output file from out.pdf to a.pdf for cleanup
The cleanup() method automatically removes certain files, but not
out.pdf. Using a.pdf prevents the file from being left behind after
the tests run.
2023-09-03 14:16:33 -04:00
Jay Berkenbilt
2b4dcb33aa
Merge pull request #1014 from m-holger/i1011
Change QPDF::copyForeignObject to return a null object when called wi…
2023-09-03 08:54:12 -04:00
m-holger
b0c3ea2bb6 Refactor test for /Pages object in QPDF::copyForeignObject
Test for missing object before accessing obj_copier.object_map.
2023-09-03 13:41:11 +01:00
m-holger
94e6323206 Fix exit code when an input other than the primary input generates warnings 2023-09-03 12:27:23 +01:00
m-holger
ca79fcb26e Add test for attempts to copy foreign /Pages object 2023-09-03 10:50:06 +01:00
Jay Berkenbilt
290a672141 Add test cases for fix-qpdf from pipe 2023-09-02 17:28:23 -04:00
Jay Berkenbilt
c51bdeb19c
Merge pull request #1017 from m-holger/mbox
Check for missing mediaboxes
2023-09-02 15:03:03 -04:00
m-holger
ac32dbc313 Reserve foreign /Page objects in QPDF::copyForeignObject
Ensure that links to foreign pages are not broken provided that the page is
subsequently copied.
2023-08-25 14:06:42 +01:00
m-holger
9a69cbba5b Check for missing mediaboxes 2023-07-29 13:16:40 +01:00
m-holger
2643ed4dd9 Add new private method QPDF::readTrailer() 2023-07-08 01:28:15 +01:00
Jay Berkenbilt
2ff7ac8a58
Merge pull request #990 from m-holger/issue600
Ensure copied annotations are fixed (fixes #600)
2023-06-17 17:54:27 -04:00
Jay Berkenbilt
0b538ec877
Merge pull request #982 from m-holger/cltidy
Apply various Clang-Tidy rules
2023-06-17 11:29:21 -04:00
m-holger
ae19d703f4 Ensure copied annotations are fixed (fixes #600)
Case where pages from a main input without /AcroForm key were duplicated
was omitted
2023-06-15 15:49:50 +01:00
m-holger
d784e8033c Code tidy - Clang-Tidy rule performance-for-range-copy 2023-06-09 15:55:49 +01:00
m-holger
0ac005f0d9 Code tidy - Clang-Tidy rule modernize-use-override 2023-06-09 15:52:56 +01:00
m-holger
5906dd5c1f Code tidy - Clang-Tidy rule modernize-use-default-member-init 2023-06-09 15:43:21 +01:00
m-holger
4490d4c35e Avoid unnecessary copying of stream dictionary in QPDF::readObject 2023-06-05 21:22:40 +01:00
Jay Berkenbilt
cfcf4318b2 Don't check sizes for old version
Otherwise we get errors if we added a class.
2023-05-21 14:42:29 -04:00
Jay Berkenbilt
60965d5f4d Rerun clang-format 2023-05-21 13:35:09 -04:00