Commit Graph

101 Commits

Author SHA1 Message Date
m-holger 4f54508f7f Refactor QPDFJob::doJSONObjects 2024-02-16 15:50:30 +00:00
Jay Berkenbilt 5b2e543089 Honor repeated overlay/underlay 2024-01-11 06:13:57 -05:00
Jay Berkenbilt 6488b156f7 Fix deleted copy constructors for Config classes 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 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 bfc5fc51f2 Remove unused argument in private setWriterOptions method 2024-01-04 07:31:00 -05:00
Jay Berkenbilt d8d70ecca2 Support comma-separated numeric values with --collate (fixes #505) 2024-01-01 18:57:32 -05:00
Jay Berkenbilt 9db5d75b2b Update copyright to 2024 2024-01-01 10:56:06 -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 909a0b3f3a Implement --disable-signatures (fixes #1015) 2023-12-23 08:50:42 -05:00
m-holger ae3642ce42 Code tidy - Clang-Tidy rule modernize-use-equals-default 2023-06-09 15:45:14 +01:00
m-holger 5906dd5c1f Code tidy - Clang-Tidy rule modernize-use-default-member-init 2023-06-09 15:43:21 +01:00
m-holger 698a70e6a8 Code tidy - reflow comments and strings 2023-05-27 10:54:19 +01:00
Jay Berkenbilt 60965d5f4d Rerun clang-format 2023-05-21 13:35:09 -04:00
Jay Berkenbilt d740c6ccce Rerun format_code (after merging clang-tidy PR) 2023-05-20 14:52:19 -04:00
Jay Berkenbilt a85635b839
Merge pull request #929 from m-holger/ogguard
Add new convenience class QPDFObjGen::Guard
2023-05-20 14:09:49 -04:00
m-holger d0682f0f60 Use nullptr instead of 0 or NULL 2023-05-20 15:41:36 +01:00
m-holger 9db2965f62 Use QPDFObjGen::set in QPDFJob::getWantedJSONObjects 2023-05-19 18:56:10 +01:00
m-holger 43d9ee56ea Split QPDFJob::run into createQPDF and writeQPDF
Also, change QPDFJob to use unique_ptr<QPDF> instead of shared pointers.
2023-03-09 17:21:55 +00:00
m-holger b27be3ed27 Remove redundant parameter from QPDFJob::handlePageSpecs and doSplitPages 2023-03-05 09:01:49 -05:00
Jay Berkenbilt c99a1ecd4f Update copyright to 2023 2023-02-25 14:18:13 -05:00
Jay Berkenbilt 48bacbf2e6 Refactor overlay/underlay in preparation for change 2023-02-25 11:25:28 -05:00
Jay Berkenbilt fe11f13d63 Add stub for --remove-restrictions 2023-01-28 13:24:45 -05:00
Jay Berkenbilt acfc9db051 QPDFJob: switch to C++11-style field initializers 2023-01-28 13:24:30 -05:00
m-holger 008364a9a4 Remove redundant friend class statements 2022-12-04 14:05:16 -05:00
Jay Berkenbilt 94c79bb8f6 Support --show-encryption without a valid password (fixes #598) 2022-09-06 12:45:12 -04:00
Jay Berkenbilt 433f1dae19 Add --report-mem-usage option for debugging/testing 2022-08-31 14:47:27 -04:00
Jay Berkenbilt a9c0b02668 Fix code formatting for deprecated 2022-07-31 17:10:55 -04:00
Jay Berkenbilt 5f4224f31a Simplify --json-output
Now --json-output just changes defaults. Allow output file with --json.
2022-07-31 16:23:17 -04:00
Jay Berkenbilt 80acfc3826 Fix --json-help to take a version parameter 2022-07-31 16:23:17 -04:00
Jay Berkenbilt 69820847af Change the output of --json to use "qpdf" instead of "objects" 2022-07-31 15:17:01 -04:00
Jay Berkenbilt 87412eb05b Add QPDFJob::registerProgressReporter 2022-06-19 08:46:58 -04:00
Jay Berkenbilt daef4e8fb8 Add more flexible funtions to qpdfjob C API 2022-06-19 08:46:58 -04:00
Jay Berkenbilt 28cc3692e3 Expose exit code values to C API via Constants.h 2022-06-18 11:36:11 -04:00
Jay Berkenbilt 641e92c6a7 QPDF, QPDFJob: use QPDFLogger instead of custom output streams 2022-06-18 09:02:55 -04:00
Jay Berkenbilt 6f43bf8de3 Major rework -- see long comments
* Replace --create-from-json=file with --json-input, which causes the
  regular input to be treated as json.
* Eliminate --to-json
* In --json=2, bring back "objects" and eliminate "objectinfo". Stream
  data is never present.
* In --json-output=2, write "qpdf-v2" with "objects" and include
  stream data.
2022-05-20 09:16:25 -04:00
Jay Berkenbilt 4fe2e06b47 Add --create-from-json and --update-from-json arguments
Also add stubs for top-level QPDF methods (createFromJSON,
updateFromJSON)
2022-05-16 13:41:40 -04:00
Jay Berkenbilt c76536dd9a Implement JSON v2 output 2022-05-08 13:45:20 -04:00
Jay Berkenbilt 15272662f6 Fix typo in json output key name
moddify -> modify. Also carefully spell checked all remaining keys by
splitting them into words and running a spell checker, not just
relying on visual proofreading. That was the only one.
2022-05-08 13:45:20 -04:00
Jay Berkenbilt 16f4f94cd9 Prepare code for JSON v2
Update getJSON() methods and calls to them
2022-05-07 11:12:01 -04:00
Jay Berkenbilt dc9b7287cd Top-level json: write incrementally
This commit just changes the order in which fields are written to the
json without changing their content. All the json files in the test
suite were modified with this script to ensure that we didn't get any
changes other than ordering.

----------
#!/usr/bin/env python3
import json
import sys

def json_dumps(data):
    return json.dumps(data, ensure_ascii=False,
                      indent=2, separators=(',', ': '))

for filename in sys.argv[1:]:
    with open(filename, 'r') as f:
        data = json.loads(f.read())
    newdata = {}
    for i in ('version', 'parameters', 'pages', 'pagelabels',
              'acroform', 'attachments', 'encrypt', 'outlines',
              'objects', 'objectinfo'):
        if i in data:
            newdata[i] = data[i]
print(json_dumps(newdata))
----------
2022-05-07 08:26:31 -04:00
Jay Berkenbilt b361c5ce19 Add --test-json-schema command-line option 2022-05-07 08:26:31 -04:00
Jay Berkenbilt 7604ac5cb2 QPDFJob: have doJSON write to a pipeline 2022-05-07 08:26:31 -04:00
Jay Berkenbilt a68703b07e Replace PointerHolder with std::shared_ptr in library sources only
(patrepl and cleanpatch are my own utilities)

patrepl s/PointerHolder/std::shared_ptr/g {include,libqpdf}/qpdf/*.hh
patrepl s/PointerHolder/std::shared_ptr/g libqpdf/*.cc
patrepl s/make_pointer_holder/std::make_shared/g libqpdf/*.cc
patrepl s/make_array_pointer_holder/QUtil::make_shared_array/g libqpdf/*.cc
patrepl s,qpdf/std::shared_ptr,qpdf/PointerHolder, **/*.cc **/*.hh
git restore include/qpdf/PointerHolder.hh
cleanpatch
./format-code
2022-04-09 17:33:29 -04:00
Jay Berkenbilt 12f1eb15ca Programmatically apply new formatting to code
Run this:

for i in  **/*.cc **/*.c **/*.h **/*.hh; do
  clang-format < $i >| $i.new && mv $i.new $i
done
2022-04-04 08:10:40 -04:00
Jay Berkenbilt d501e1c0d4 Only update output version from files used as input
If we're opening a PDF file to copy its encryption information or
attachments, its version doesn't need to influence the output version.
2022-02-08 13:49:22 -05:00
Jay Berkenbilt f91b21c7d4 Preserve input PDF version on pages/split-pages (fixes #610) 2022-02-08 12:34:14 -05:00
Jay Berkenbilt cfaa2de804 Update copyright for 2022 2022-02-04 16:36:22 -05:00