Jay Berkenbilt
23bcfeb336
Remove bogus test cheating code
2019-01-02 21:49:47 -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
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
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
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
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
Jay Berkenbilt
313ba08126
Preserve some outline functionality in page splitting
2018-12-21 19:11:57 -05:00
Jay Berkenbilt
d5d179f441
Add document and object helpers for outlines (bookmarks)
2018-12-21 19:11:57 -05:00
Jay Berkenbilt
0776c00129
Add QPDFNameTreeObjectHelper
2018-12-21 18:34:56 -05:00
Jay Berkenbilt
352ce9b22b
Preserve page labels (numbers) when splitting and merging
2018-12-18 16:59:24 -05:00
Jay Berkenbilt
6ef9e31233
Add QPDFPageLabelDocumentHelper
2018-12-18 16:59:24 -05:00
Jay Berkenbilt
f38df27aa3
Add QPDFNumberTreeObjectHelper
2018-12-18 16:46:10 -05:00
Jay Berkenbilt
88fb2e5258
Workaround for fragile test on Windows
2018-10-16 11:41:00 -04:00
Jay Berkenbilt
28453a4908
Add --keep-files-open flag ( fixes #237 )
2018-08-18 10:56:01 -04:00
Jay Berkenbilt
7214ba2303
Fix memory error on virus workaround code
2018-08-14 16:41:13 -04:00
Jay Berkenbilt
164cbdde46
Protect against virus warnings ( fixes #216 )
...
Some files in the test suite trigger antivirus warnings. These are
not infected files with malicious intent. They are test files to
ensure that qpdf does not crash when it encounters the files. This
change enables those files to be obfuscated in the source repository
so that checking out qpdf from version control or extracting the
source code doesn't trigger antivirus warnings.
2018-08-13 19:26:20 -04:00
Jay Berkenbilt
fb1e29476c
Add --no-warn option to suppress warnings ( fixes #232 )
2018-08-12 22:20:40 -04:00
Jay Berkenbilt
a2f62935b3
Catch exceptions as const references ( fixes #236 )
...
This fix allows qpdf to compile/test cleanly with gcc 8.
2018-08-12 21:57:52 -04:00
Jay Berkenbilt
4a4736c695
Fix EOL handling inside strings ( fixes #226 )
...
CR, CRLF, and LF are all supposed to be treated as LF; only one EOL is
to be ignored after backslash.
2018-08-05 20:48:35 -04:00
Jay Berkenbilt
e1cd5891af
Fix infinite loop on small files with progress reporting ( fixes #230 )
...
Turns out you can keep adding zero to a number over and over again and
it just doesn't get any bigger. Who would have known?
2018-08-05 15:43:34 -04:00
Jay Berkenbilt
fe769f2723
Keep file open while adding its pages during merge ( fixes #217 )
2018-08-04 19:58:13 -04:00
Jay Berkenbilt
3aad28aed0
Bug fix: honor encryption key length with R=3 ( fixes #212 )
2018-06-22 19:24:26 -04:00
Jay Berkenbilt
c852af2a57
Add tests for progress and verbose changes
2018-06-22 16:14:54 -04:00
Jay Berkenbilt
6bf47ac6e8
With --verbose, give information on processing merge inputs
2018-06-22 16:14:54 -04:00
Jay Berkenbilt
a433ed24f9
Add progress reporting for QPDFWriter ( fixes #200 )
2018-06-22 16:14:54 -04:00
Jay Berkenbilt
99593e0eef
Use ClosedFileInputSource when merging files ( fixes #154 )
2018-06-22 12:53:41 -04:00
Jay Berkenbilt
c71dc6888c
Don't prune resource dictionaries on errors or by request
...
If we are unable to filter a page's content streams, don't attempt to
remove objects from the page's resource dictionary. Also provide a
command line option to suppress resource removal in case we ever need
this as a workaround for some bug or broken PDF files.
2018-06-22 10:45:31 -04:00
Jay Berkenbilt
38c9ed23c3
Treat content stream parsing errors as an error, not a warning
...
If parsing content streams is treated as a warning, there is no way
for a caller to know if a parsing operation has failed. This is very
dangerous and will likely result in data loss when token filters are
parser callbacks are in use.
2018-06-22 10:44:08 -04:00
Jay Berkenbilt
6c89d4b35b
When splitting files, remove unreferenced objects ( fixes #203 )
2018-06-21 21:03:30 -04:00
Jay Berkenbilt
ddd78c1b7f
Fix QPDFObjectHandle::shallowCopy
...
It's not really a shallow copy. It just doesn't cross indirect object
boundaries. The old implementation had a bug that would cause multiple
shallow copies of the same object to share memory, which was not the
intention.
2018-06-21 20:34:45 -04:00
Jay Berkenbilt
84cd53f5af
Make page range optional in --rotate ( fixes #211 )
2018-06-21 16:28:44 -04:00
Jay Berkenbilt
397b097c46
Allow setting a form field's value
2018-06-21 15:57:13 -04:00