Commit Graph

968 Commits

Author SHA1 Message Date
m-holger 85107f39f2 Add bad xref table test 2024-03-06 15:26:14 +00:00
m-holger 862feed100 Add additional QPDFObjectHandle::Rectangle and Matrix tests 2024-02-20 14:53:18 +00:00
m-holger 36ee4ecc6e Add test for QPDFObjectHandle::isDirectNull 2024-02-20 13:02:16 +00:00
m-holger a047d5497e Add test for QPDFObjectHandle::getStreamJSON 2024-02-20 00:49:41 +00:00
Jay Berkenbilt 7bc52c5728 set page labels: detect start page < 1 (fixes #939) 2024-02-17 16:13:42 -05:00
Jay Berkenbilt e362bce8e8 Merge branch 'jw' from #1146 into work 2024-02-17 14:15:48 -05:00
m-holger f0bc2f11ef Expose QPDFObjectHandle::writeJSON 2024-02-16 14:09:28 +00:00
m-holger 9379b76811 Add additional name token JSON tests
Also, test writing JSON v1 files and files with deeply nested containers.
2024-02-16 10:54:08 +00:00
m-holger d28969bf37 Add additional sparse array JSON tests 2024-02-16 10:53:52 +00:00
Jay Berkenbilt b1dad0de2a Fix previous fix to setting checkbox value (fixes #1056)
The code accepted values other than /Yes but still used /Yes as the
checked value instead of obeying the normal appearance dictionary.
2024-02-11 15:49:44 -05:00
Jay Berkenbilt 3490090fbc Detect JSON object whose value is an indirect object 2024-02-06 15:12:41 -05:00
Jay Berkenbilt cb0f390cc1 Handle parse error stream data (fixes #1123)
A parse error in stream data in which stream data contained a nested
object would cause a crash because qpdf was not correctly updating its
internal state. Rework the QPDF json reactor to not be sensitive to
parse errors in this way.
2024-02-04 17:27:49 -05:00
m-holger 8ff20b0089 Allow "n:/pdf-syntax" JSON syntax for dictionary keys 2024-01-29 13:22:58 +00:00
m-holger f0343565ed Tighten checks for invalid indirect references during xref reconstruction 2024-01-17 14:11:57 +00:00
m-holger ed43691bf3 Tighten checks for invalid indirect references in QPDFParser 2024-01-17 13:15:13 +00:00
Jay Berkenbilt ebb10f3256 Fix null pointer issue on array copy 2024-01-12 08:05:22 -05:00
Jay Berkenbilt d339f8ad1a Add non-trivial multiple overlay/underlay tests 2024-01-11 06:13:57 -05:00
Jay Berkenbilt 90a97bf4ef Include filename in verbose output for overlay/underlay 2024-01-11 06:13:57 -05:00
Jay Berkenbilt 12f7a4461b Handle pages/under/overlay JSON file in begin
...since they have to be handled before other options. It was working
because, in both cases, `file` was alphabetically before the other
keys, but this implementation gives a stronger guarantee.
2024-01-10 16:45:14 -05:00
Jay Berkenbilt 9c723aeb56 Allow --file with --overlay and --underlay 2024-01-10 16:44:46 -05:00
Jay Berkenbilt 34f013c1be Allow --file and --range with --pages
Accept --file and --range as named parameters in additional to
allowing positional arguments. This is in preparation for adding
additional flags.
2024-01-10 16:44:17 -05:00
Jay Berkenbilt 20a134826c Fix arg parsing check with --collate
The check for the number of items was in the wrong place.
2024-01-10 06:49:31 -05:00
Jay Berkenbilt 07f6c635a9 Bug fix: treat old generations of reused objects as null 2024-01-07 17:16:14 -05:00
Jay Berkenbilt 94b4e900b2 Add better tests for generation > 0 with object streams
This includes an expected failure for a file with a dangling
reference to an old generation.
2024-01-07 16:06:19 -05:00
Jay Berkenbilt d54bd7b265 Add failing tests to illustrate qpdf's generation bug 2024-01-07 15:22:22 -05:00
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