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

261 Commits

Author SHA1 Message Date
Jay Berkenbilt
0364024781 Use QPDFUsage exception for cli, json, and QPDFJob errors 2022-01-30 13:11:03 -05:00
Jay Berkenbilt
9373881cca Add QPDFJob::ConfigError exception 2022-01-30 13:11:03 -05:00
Jay Berkenbilt
b9cd693a5b QPDFJob: allocate QPDFArgParser on stack
The previous commits have removed all references to memory from
QPDFArgParser from QPDFJob. This commit removes the constraint that
QPDFArgParser remain in scope. This is a prerequisite to allowing JSON
as an alternative way to initialize QPDFJob and to initialize it
directly using a public API.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
5c5e5ca29b Document how to add a command-line argument 2022-01-30 13:11:03 -05:00
Jay Berkenbilt
bd89aac360 QPDFJob increment: move arg parsing into QPDFJob
Move ArgParser from qpdf.cc into QPDFJob.cc. It still works with
millions of public member variables, but now qpdf.cc is minimal and
just calls stable library functions.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
23b64f8357 Remove qpdf.cc version check
Remove comparison of qpdf CLI version with library. With almost all
the functionality moving into the library, this check is no longer
meaningful.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
1ddf5b4b4b QPDFJob increment: get rid of exit, handle verbose
Remove all calls to exit() from QPDFJob. Handle code that runs in
verbose mode to enable it to make use of output streams and message
prefix (whoami) from QPDFJob. This removes temporarily duplicated exit
code logic and most access to whoami/std::cout outside of QPDFJob
proper.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
0910e767ad QPDFJob increment: basic QPDFJob structure
Move most of the methods called from qpdf.cc after argument parsing
into QPDFJob. In this increment, enough QPDFJob API has been added to
handle the branch of QPDFJob::run() that creates output with an
appropriate division between qpdf.cc and QPDFJob.

There are temporary bits of code to enable everything to compile and
pass the test suite, including some duplication and hard-coded values.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt
8c718b7e6f Prefix program name before exception message in qpdf CLI 2022-01-30 13:11:02 -05:00
Jay Berkenbilt
c60b4ea55a Refactor arg parsing in qpdf.cc to use QPDFArgParser 2022-01-30 13:11:02 -05:00
Jay Berkenbilt
af91b5b584 Add QUtil::file_can_be_opened 2021-12-29 13:41:02 -05:00
Jay Berkenbilt
ac0060ac38 Refactor arg parsing to allow help option with parameter 2021-12-29 13:35:05 -05:00
Jay Berkenbilt
04745320d6 Prepare 10.5.0 release 2021-12-20 14:51:46 -05:00
Jay Berkenbilt
08bcf6449c Clarify docs around @filename and leading/trailing space 2021-12-10 15:52:28 -05:00
m-holger
0c705a882b Minor documentation updates 2021-12-09 10:24:14 -05:00
Jay Berkenbilt
ce7db05d22 Prepare 10.4.0 release 2021-11-16 15:44:09 -05:00
Jay Berkenbilt
750aca5b94 First increment of improving handling of weak crypto (fixes #358) 2021-11-11 12:24:15 -05:00
Jay Berkenbilt
9b28933647 Check object ownership when adding
When adding a QPDFObjectHandle to an array or dictionary, if possible,
check if the new object belongs to the same QPDF. This makes it much
easier to find incorrect code than waiting for the situation to be
detected when the file is written.
2021-11-04 12:29:42 -04:00
Jay Berkenbilt
73752683c9 Fix overlay/underlay on page with no resources (fixes #527) 2021-11-03 16:00:05 -04:00
Jay Berkenbilt
7ed991343b Better diagnostics when --pages is not closed (fixes #555) 2021-11-02 16:22:37 -04:00
Jay Berkenbilt
df38fe8e48 Fix string bounds checking in completion code (fixes #441) 2021-05-13 13:06:58 -04:00
Jay Berkenbilt
bddebdb0ea Prepare 10.3.2 release 2021-05-08 10:41:14 -04:00
Jay Berkenbilt
3f05429cc5 Prepare 10.3.1 release 2021-03-11 12:59:41 -05:00
Jay Berkenbilt
972e08af58 Protect against future bugs in fixCopiedAnnotations
I don't want additional, undiscovered bugs to fully block page
splitting/merging operations.
2021-03-11 12:49:27 -05:00
Jay Berkenbilt
dc65b88457 Prepare 10.3.0 release 2021-03-05 06:15:48 -05:00
Jay Berkenbilt
addc0672d1 Tweak form copying to avoid gratuitous field renames
When copying a page from the original file to the output in --pages,
don't alter the fields or annotations for the first copy of each page.
2021-03-05 05:31:15 -05:00
Jay Berkenbilt
9fb174b9e9 Major rework of handling form fields when copying pages (fixes #509) 2021-03-04 15:08:37 -05:00
Jay Berkenbilt
b5e937397c Prepare 10.2.0 release 2021-02-23 10:41:58 -05:00
Jay Berkenbilt
1886673d7e Spell check 2021-02-23 10:38:05 -05:00
Jay Berkenbilt
039eb4a253 Fix input file = output file test for split pages 2021-02-23 08:26:21 -05:00
Jay Berkenbilt
be3a8c0e7a Keep only referenced form fields in --pages 2021-02-23 08:26:21 -05:00
Jay Berkenbilt
83216e640c Preserve form fields when splitting pages (fixes #340) 2021-02-22 18:42:06 -05:00
Jay Berkenbilt
8e8c0d8290 Add new placeFormXObject that takes a matrix reference 2021-02-22 18:42:06 -05:00
Jay Berkenbilt
61d41e2e88 Add copyAnnotations, use with overlay/underlay (fixes #395) 2021-02-22 18:42:06 -05:00
Jay Berkenbilt
7b3cbacf5d Change from QPDF{Array,Dict}Items to aitems() and ditems() 2021-02-22 11:05:39 -05:00
Jay Berkenbilt
a9ae8cadc6 Add transformAnnotations and fix flattenRotations to use it 2021-02-21 17:13:09 -05:00
Jay Berkenbilt
35dd11f356 Allow --rotate=0 2021-02-20 16:29:34 -05:00
Jay Berkenbilt
0a52e60ece Use QUtil::path_basename 2021-02-18 09:59:03 -05:00
Jay Berkenbilt
dfce581754 Add numeric argument to --collate
This takes pages from the file in groups of n with default = 1. This
partially fixes the enhancement in issue #505 but doesn't implement
the entire suggestion.
2021-02-17 20:07:45 -05:00
Jay Berkenbilt
accb891b4f Add attachment information to the json output 2021-02-10 15:46:18 -05:00
Jay Berkenbilt
832d792e4e Add CLI support for working with attachments 2021-02-10 10:03:27 -05:00
Jay Berkenbilt
af557db4a4 Cosmetic fix to help 2021-02-06 13:45:43 -05:00
Jay Berkenbilt
3de67173de Better fix to insecure password check (fixes #501) 2021-02-04 20:44:05 -05:00
Jay Berkenbilt
63158cf546 Add --password-file=filename option (fixes #499) 2021-02-04 16:48:53 -05:00
Jay Berkenbilt
21b0f4acfc Require --allow-insecure to create certain encrypted files (fixes #501)
For now, --allow-insecure allows creation of files with the owner
passwords empty or matching the user password.
2021-02-04 15:57:13 -05:00
Jay Berkenbilt
5fdf37b1ba Handle warnings in --pages from other files
Warnings were not being handled per --no-warn or generating exit code 3.
2021-02-02 18:06:05 -05:00
Jay Berkenbilt
0fed040392 Prepare version 10.1.0 2021-01-04 16:59:55 -05:00
Jay Berkenbilt
bf8fd41fee Update copyright to 2021 2021-01-04 16:26:58 -05:00
Jay Berkenbilt
891751f618 Remove unreferenced resources only from relevant pages 2021-01-04 15:17:35 -05:00
Jay Berkenbilt
a9bdeeb0e0 Fix zsh completion arguments (fixes #473) 2021-01-04 15:17:35 -05:00