2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-10 22:22:27 +00:00
Commit Graph

541 Commits

Author SHA1 Message Date
m-holger
85107f39f2 Add bad xref table test 2024-03-06 15:26:14 +00:00
Jay Berkenbilt
e362bce8e8 Merge branch 'jw' from #1146 into work 2024-02-17 14:15:48 -05: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
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
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
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
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
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
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
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
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
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
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
4490d4c35e Avoid unnecessary copying of stream dictionary in QPDF::readObject 2023-06-05 21:22:40 +01:00
Jay Berkenbilt
293a2e52b3 Disregard appearance state when irrelevant (fixes #949)
If /AP is a dictionary of streams rather than a dictionary of
dictionaries, disregard /AS, which is supposed to point to a subkey of
one of the dictionaries. This fix prevents qpdf's annotation
flattening from discarding some annotations when /AS is erroneously
set.
2023-05-20 15:46:16 -04:00