2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-09-20 17:19:08 +00:00
Commit Graph

1314 Commits

Author SHA1 Message Date
Jay Berkenbilt
2e342ee5bb Spell check 2019-01-04 21:33:14 -05:00
Jay Berkenbilt
ee2aad4381 Add CLI flags for image optimization 2019-01-04 21:33:14 -05:00
Jay Berkenbilt
6f3b76b6c1 Fix image-streams.pdf in test suite
Some of the images were supposed to have no filter, but somewhere
along the line, they ended up with /FlateDecode, most likely because
qpdf rewrote the file without having --compress-streams=n specified.
If this error is repeated, it will cause a test failure.
2019-01-04 20:13:56 -05:00
Jay Berkenbilt
7b6ab900dc Support page collation with --collate (fixes #259) 2019-01-04 15:13:02 -05:00
Jay Berkenbilt
16fd6e64f9 Add QPDFWriter::getFinalVersion (fixes #266) 2019-01-04 12:37:22 -05:00
Jay Berkenbilt
837dcf8fc2 Don't call assert while checking linearization data (fixes #209, #231)
Instead of calling assert for problems found during checking
linearization data, throw an exception which is later caught and
issued as an error. Ideally we would handle errors more robustly, but
this is still a significant improvement.
2019-01-04 11:55:42 -05:00
Jay Berkenbilt
a01359189b Fix dangling references (fixes #240)
On certain operations, such as iterating through all objects and
adding new indirect objects, walk through the entire object structure
and explicitly resolve any indirect references to non-existent
objects. That prevents new objects from springing into existence and
causing the previously dangling references to point to them.
2019-01-04 10:29:29 -05:00
Jay Berkenbilt
158156d506 Add basic appearance stream generation 2019-01-04 08:00:19 -05:00
Jay Berkenbilt
02281632cc Add QUtil::utf8_to_ascii 2019-01-03 23:18:13 -05:00
Jay Berkenbilt
b55567a0fa Add special case setV code for button fields 2019-01-03 23:18:13 -05:00
Jay Berkenbilt
1342612308 Replace need-appearances.pdf
Create a new need-appearances.pdf based on newer test files with more
modified fields.
2019-01-03 23:18:13 -05:00
Jay Berkenbilt
e3144ac417 Add form fields to json output
Also add some additional methods for detecting form field types to
assist in the json creation and for later use.
2019-01-03 23:18:13 -05:00
Jay Berkenbilt
26393f5137 New test file with form field types 2019-01-03 23:18:13 -05:00
Jay Berkenbilt
87f855dbfc Rename test file 2019-01-03 23:18:13 -05:00
Jay Berkenbilt
ca94ac68d9 Honor flags when flattening annotations 2019-01-03 11:59:55 -05:00
Jay Berkenbilt
06d6438ddf Minor fixes 2019-01-03 09:17:43 -05:00
Jay Berkenbilt
3e74916c5a Fix seg fault on empty xref stream (fixes #263)
Thanks to @p-cher for supplying a patch.
2019-01-03 09:17:43 -05:00
Jay Berkenbilt
f78ea057ca Switch annotation flattening to use the form xobjects
Instead of directly putting the contents of the annotation appearance
streams into the page's content stream, add commands to render the
form xobjects directly. This is a more robust way to do it than the
original solution as it works properly with patterns and avoids
problems with resource name clashes between the pages and the form
xobjects.
2019-01-02 21:49:47 -05:00
Jay Berkenbilt
23bcfeb336 Remove bogus test cheating code 2019-01-02 21:49:47 -05:00
Jay Berkenbilt
3dbbf9f240 TODO 2019-01-01 08:38:15 -05:00
Jay Berkenbilt
3b8ce4f12a Annotation flattening including form fields
Flatten annotations by integrating their appearance streams into the
content stream of the containing page. In the case of form fields,
only flatten if /NeedAppearance is false (or equivalently absent). If
flattening form fields, also remove /AcroForm from the document
catalog.
2019-01-01 08:14:15 -05:00
Jay Berkenbilt
95d6b17a89 Add QPDFObjectHandle::mergeDictionary() 2019-01-01 08:12:56 -05:00
Jay Berkenbilt
104fd6da52 Add matrix and annotation appearance stream handling
Generate page content fragment for rendering appearance streams
including all matrix calculation.
2019-01-01 08:07:21 -05:00
Jay Berkenbilt
5059ec0d35 Add Matrix class under QPDFObjectHandle 2018-12-31 23:02:43 -05:00
Jay Berkenbilt
daeb5a85b6 Transformation matrix 2018-12-31 18:23:47 -05:00
Jay Berkenbilt
3440ea7d3c JSON::serialize -> unparse
Unparse is admittedly strange, but I'd rather be strange and
consistent, and everything else in the qpdf library uses unparse to
serialize. (If you're reading this, the convention of using "unparse"
comes from the "clu" programming language.)
2018-12-25 11:52:21 -05:00
Jay Berkenbilt
2e2223ffe1 TODO 2018-12-23 11:54:10 -05:00
Jay Berkenbilt
6048c6e2f0 Don't crash on @file when file doesn't exist (fixes #265)
When @file is used and file doesn't exist, just treat it as a normal
argument.
2018-12-23 11:46:56 -05:00
Jay Berkenbilt
968e7e60b7 Add json tests 2018-12-23 11:21:59 -05:00
Jay Berkenbilt
64c1579544 Support zsh completion 2018-12-23 11:21:59 -05:00
Jay Berkenbilt
2e306d3249 Add comment about json to pdf-bookmarks 2018-12-23 09:15:46 -05:00
Jay Berkenbilt
76bf863aaa Add page position information to json 2018-12-23 09:15:40 -05:00
Jay Berkenbilt
52a0b767c8 Slightly improve bash completion arg parsing 2018-12-23 09:15:40 -05:00
Jay Berkenbilt
6b90f3db4d Document new and missing command-line options 2018-12-23 09:15:40 -05:00
Jay Berkenbilt
24aeb9ae22 Document json support 2018-12-22 14:05:01 -05:00
Jay Berkenbilt
86f9b4c43b Add colorspace and depth information in json for images 2018-12-22 11:42:38 -05:00
Jay Berkenbilt
62ea3b9197 Add outlines to json at document level 2018-12-22 11:42:38 -05:00
Jay Berkenbilt
ae9455bf44 Implement --json-objects 2018-12-22 11:42:38 -05:00
Jay Berkenbilt
ce714ac9b8 Call cleanup between test sections 2018-12-22 11:42:38 -05:00
Jay Berkenbilt
fa3051d977 Implement --json-keys 2018-12-22 11:42:38 -05:00
Jay Berkenbilt
2008d037b3 Handle help args using option tables; add json help 2018-12-22 11:42:38 -05:00
Jay Berkenbilt
b3da5a2cba Switch json args and structure 2018-12-22 11:42:38 -05:00
Jay Berkenbilt
7985c77326 Completion: ignore characters at and after point 2018-12-22 11:42:37 -05:00
Jay Berkenbilt
bb89382f93 Allow --show-object=trailer 2018-12-21 19:11:57 -05:00
Jay Berkenbilt
dd1aca552c Support bash completion using complete -C 2018-12-21 19:11:57 -05:00
Jay Berkenbilt
3c075fc017 Table-driven parsing of encrypt options 2018-12-21 19:11:57 -05:00
Jay Berkenbilt
245723c570 Table-driven parsing for top-level arguments 2018-12-21 19:11:57 -05:00
Jay Berkenbilt
151206603b Move argument parsing into a class 2018-12-21 19:11:57 -05:00
Jay Berkenbilt
6580ffe983 Preliminary implementation of json mode
The json mode implemented in this commit is not the final version, or
are the command line arguments used to invoke it.
2018-12-21 19:11:57 -05:00
Jay Berkenbilt
fa3664357b Move numrange code from qpdf.cc to QUtil.cc
Also move tests to libtests.
2018-12-21 19:11:57 -05:00