2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-10-31 19:02:30 +00:00
Commit Graph

780 Commits

Author SHA1 Message Date
Jay Berkenbilt
b745920961 Allow specific performance tests to be run 2022-10-08 16:10:15 -04:00
Jay Berkenbilt
6826330adc Require a C++-17 compiler 2022-10-06 06:58:38 -04:00
Jay Berkenbilt
236a02d402 Prepare 11.1.1 release 2022-10-01 12:04:50 -04:00
Jay Berkenbilt
f4ca04cec1 Fix edge case in character encoding (fixes #778)
Avoid representing as PDF Doc encoding any string whose PDF Doc
encoding representation starts with a UTF-16 or UTF-8 marker.
2022-09-26 08:06:47 -04:00
Jay Berkenbilt
e39f14eaf0 Prepare 11.1.0 release 2022-09-14 15:44:17 -04:00
Jay Berkenbilt
faac493a5d Force project includes before system includes (fixes #763)
From time to time, someone has a problem because their build is
grabbing an old version of qpdf header files that are installed
somewhere on their system. I am hoping this will put an end to that.
2022-09-14 07:41:13 -04:00
Jay Berkenbilt
d780954bb3 Add some missing QPDF_DLL markers
These markers are being added for nested classes that are already
marked with QPDF_DLL_CLASS. They don't make any different on Linux,
but they matter on Windows.
2022-09-12 13:19:07 -04:00
Jay Berkenbilt
4963ce6a53 Remove obsolete LL_FMT check from build (fixes #768)
This was broken for cross-compilation and has probably been
unnecessary for several years now.

Also fix extraneous whitespace in related some tests.
2022-09-12 11:48:38 -04:00
Jay Berkenbilt
43035c8987 Prepare 11.0.0 release 2022-09-10 09:46:09 -04:00
Jay Berkenbilt
8a3cdfd2af Change QPDFObjectHandle == to isSameObjectAs
Replace operator== and operator!=, which were testing for the same
underlying object, with isSameObjectAs. This change was motivated by
the fact that pikepdf internally had its own operator== method for
QPDFObjectHandle that did structural comparison. I backed out qpdf's
operator== as a courtesy to pikepdf (in my own testing) but also
because I think people might naturally assume that operator== does a
structural comparison, and isSameObjectAs is clearer in its intent.
2022-09-09 18:09:40 -04:00
Jay Berkenbilt
3dbab589e3 Add C API functions for using custom loggers
Expose functions to the C API to create new loggers and to setLogger
and getLogger for QPDF and QPDFJob.
2022-09-09 10:49:25 -04:00
Jay Berkenbilt
f1a2d3160a Add JSON v2 support to C API 2022-09-09 06:19:09 -04:00
Jay Berkenbilt
dba61da1bf Create a special "destroyed" type rather than using null
When a QPDF is destroyed, changing indirect objects to direct nulls
makes them effectively disappear silently when they sneak into other
places. Instead, we should treat this as an error. Adding a destroyed
object type makes this possible.
2022-09-08 10:36:39 -04:00
Jay Berkenbilt
0132261ee0 Revert getOwningQPDF, and add getQPDF that returns a reference 2022-09-07 17:26:39 -04:00
Jay Berkenbilt
76cd7ea67a Clarify and improve QPDFPageObjectHelper::get*Box methods
Add copy_if_fallback and explain how it differs from copy_if_shared.
2022-09-06 19:00:40 -04:00
Jay Berkenbilt
c1def4ead4 Implement QPDFObjectHandle equality 2022-09-06 18:34:23 -04:00
Jay Berkenbilt
94c79bb8f6 Support --show-encryption without a valid password (fixes #598) 2022-09-06 12:45:12 -04:00
Jay Berkenbilt
0a7ba62b00 Update formatting a documentation from last PR 2022-09-05 18:52:59 -04:00
Jay Berkenbilt
a59e7ac7ec Disable copying/assigning to QPDF objects, add QPDF::create() 2022-09-02 08:53:27 -04:00
Jay Berkenbilt
b663926538 Remove QPDFObject::object_type_e as alias for qpdf_object_type_e 2022-09-01 18:11:22 -04:00
Jay Berkenbilt
e94f478217 Update ChangeLog and Release Notes from previous pull requests 2022-09-01 17:15:41 -04:00
Jay Berkenbilt
7b3134ef94 Add ChangeLog for previous contribution
Also remove no-longer-needed #include
2022-08-31 15:06:37 -04:00
Jay Berkenbilt
394302a411 Add ChangeLog/release-notes (with credit) for last pull request 2022-08-27 08:14:36 -04:00
Jay Berkenbilt
cef6425bca Disable QTC inside the library by default (fixes #714)
This results in measurable performance improvements to packaged binary
libqpdf distributions. QTC remains available for library users and is
still selectively enabled in CI.
2022-08-07 16:20:49 -04:00
Jay Berkenbilt
433be3718a Update ChangeLog for recent changes 2022-08-06 16:35:22 -04:00
Jay Berkenbilt
8ad39a6c9a Spell check 2022-07-31 10:32:55 -04:00
Jay Berkenbilt
4674c04cb8 JSON schema: support multi-element array validation 2022-07-24 16:44:51 -04:00
Jay Berkenbilt
f8d1ab9462 JSON schema -- accept single item in place of array
When the schema wants a variable-length array, allow a single item as
well as allowing an array.
2022-07-24 16:17:03 -04:00
Jay Berkenbilt
b3e6d445cb Tweak "AndGet" mutator functions again
Remove any ambiguity around whether old or new value is being
returned.
2022-07-24 15:42:23 -04:00
Jay Berkenbilt
d27edd54c4 Add ChangeLog and release notes for previous contribution 2022-07-24 14:47:40 -04:00
Jay Berkenbilt
db8a02c20e Add ChangeLog for last commit 2022-06-27 12:49:46 -04:00
Jay Berkenbilt
bb0ea2f8e7 Add qpdfjob_register_progress_reporter 2022-06-19 08:46:58 -04:00
Jay Berkenbilt
8130d50e3b Add C API to QPDFLogger 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
83be2191b4 Use "save" logger when saving data to standard output
This includes the output PDF, streams from --show-object and
attachments from --save-attachment. This also enables --verbose and
--progress to work with saving to stdout.
2022-06-18 09:54:40 -04:00
Jay Berkenbilt
641e92c6a7 QPDF, QPDFJob: use QPDFLogger instead of custom output streams 2022-06-18 09:02:55 -04:00
Jay Berkenbilt
f588d74140 Add integer types to Pipeline::operator<< 2022-06-18 09:02:55 -04:00
Jay Berkenbilt
aa800d2a3b ChangeLog, release notes for json v2 2022-05-31 07:20:47 -04:00
Jay Berkenbilt
b7bbf12e85 In json mode, reveal recovered user password when otherwise unavailable 2022-05-30 20:03:08 -04:00
Jay Berkenbilt
f049a77c59 Add additional information when listing attachments 2022-05-30 20:03:08 -04:00
Jay Berkenbilt
04fc7c4bea Add conversions to ISO-8601 date format 2022-05-30 20:03:08 -04:00
Jay Berkenbilt
23fc6756f1 Add QUtil::FileCloser to the public API 2022-05-20 09:16:25 -04:00
Jay Berkenbilt
63c7eefe9d replaceStreamData: accept uninitialized filter/decode_parms
These mean to leave the original values alone. This is needed for
reconstructing streams from JSON given that the stream data and stream
dictionary may appear in any order in the JSON.
2022-05-20 09:16:25 -04:00
Jay Berkenbilt
56f1b411fe Back out fluent QPDFObjectHandle methods. Keep the andGet methods.
I decided these were confusing and inconsistent with how JSON works.
They muddle the API rather than improving it.
2022-05-20 09:16:25 -04:00
Jay Berkenbilt
60ec94a7c3 Add QUtil::is_long_long 2022-05-16 13:39:26 -04:00
Jay Berkenbilt
0500d4347a JSON: add blob type that generates base64-encoded binary data 2022-05-06 19:14:52 -04:00
Jay Berkenbilt
e5f3910c3e Add new FileInputSource constructors 2022-05-04 12:07:11 -04:00
Jay Berkenbilt
e259635986 JSON: add write methods and implement unparse() in terms of those 2022-05-04 12:07:11 -04:00
Jay Berkenbilt
8b25de24c9 Make "objects" and "pages" consistent in JSON output 2022-05-04 08:32:44 -04:00
Jay Berkenbilt
f4206a0938 Add new Pl_String Pipeline 2022-05-03 18:54:51 -04:00
Jay Berkenbilt
16139d97c8 Add new Pl_OStream Pipeline 2022-05-03 18:54:51 -04:00
Jay Berkenbilt
f1c6bb97db Add new Pipeline convenience methods 2022-05-03 18:31:22 -04:00
Jay Berkenbilt
59f3e09edf Make Pipeline::write take an unsigned char const* (API change) 2022-05-03 18:31:22 -04:00
Jay Berkenbilt
8d2a0eda5a Add reactors to the JSON parser 2022-05-01 19:55:52 -04:00
Jay Berkenbilt
8ccd3a8a89 Mark weak encryption with API changes (fixes #576) 2022-04-30 17:24:15 -04:00
Jay Berkenbilt
cff26040d8 Using insecure crytpo from the CLI is now an error by default 2022-04-30 17:23:58 -04:00
Jay Berkenbilt
c365a26e9d Revert "Remove QPDFObjectHandle::replaceOrRemoveKey"
This reverts commit dc059560e7.

I changed my mind. There's no harm in leaving it deprecated for a
release cycle.
2022-04-30 14:15:07 -04:00
Jay Berkenbilt
dc059560e7 Remove QPDFObjectHandle::replaceOrRemoveKey
See ChangeLog for rationale for not deprecating it as originally
planned.
2022-04-30 13:39:45 -04:00
Jay Berkenbilt
e80fad86e9 Add new QPDFObjectHandle methods for more fluent programming 2022-04-29 20:09:10 -04:00
Jay Berkenbilt
d0b7cc8ac6 QPDFJob json: make removeAttachment take an array (fixes #693) 2022-04-24 13:06:19 -04:00
Jay Berkenbilt
4be2f36049 Deprecate replaceOrRemoveKey -- it's the same as replaceKey 2022-04-24 09:31:32 -04:00
Jay Berkenbilt
68e721981a Add new QPDF::warn that takes most of QPDFExc's arguments 2022-04-23 18:25:43 -04:00
Jay Berkenbilt
22b35c4928 Expose QUtil::get_next_utf8_codepoint 2022-04-23 18:25:43 -04:00
Jay Berkenbilt
75fe4f60c3 Use anonymous namespaces for file-private classes 2022-04-16 13:35:27 -04:00
Jay Berkenbilt
6df6260751 Change default --json from 1 to latest 2022-04-16 12:57:33 -04:00
Jay Berkenbilt
fc1bfe4a66 Add ChangeLog entries and release notes for previous work 2022-04-16 12:52:59 -04:00
Jay Berkenbilt
e4484fd94c Update ChangeLog and release notes 2022-03-18 19:53:18 -04:00
Jay Berkenbilt
09a36ad62b Run Windows build on Windows 2022 runner 2022-03-08 12:32:06 -05:00
Jay Berkenbilt
b83a652420 Prepare 10.6.3 release 2022-03-07 18:22:34 -05:00
Jay Berkenbilt
584793ea1e Spell check, update release notes for 10.6.3 2022-03-07 18:22:34 -05:00
Jay Berkenbilt
36794a60cf Allow \/ in a json string 2022-02-25 11:42:50 -05:00
Jay Berkenbilt
f7ac591590 Recognize explicit UTF-8 strings (fixes #654) 2022-02-22 08:10:05 -05:00
Jay Berkenbilt
31b45b0fd4 Fix logic error with Tf when generating appearances (fixes #655) 2022-02-18 13:46:35 -05:00
Jay Berkenbilt
38d8362c09 Prepare 10.6.2 release 2022-02-15 19:36:39 -05:00
Jay Berkenbilt
74d66a9349 Spell check 2022-02-15 19:36:12 -05:00
Jay Berkenbilt
e810fe678a Fix asymmetry between newUnicodeString and getUTF8Value 2022-02-15 19:22:35 -05:00
Jay Berkenbilt
a478cbb6dc Silently/transparently recognize UTF-16LE as UTF-16 (fixes #649)
The PDF spec only allows UTF-16BE, but most readers seem to accept
UTF-16LE as well, so now qpdf does too.
2022-02-15 16:13:12 -05:00
Jay Berkenbilt
fbd3e56da7 Ignore -- at the top level arg parser (fixes #652)
This was unintended behavior that was added back for backward
compatibility. It is intentionally undocumented.
2022-02-15 16:13:12 -05:00
Jay Berkenbilt
1065bbb016 Handle odd PDFDoc codepoints in UTF-8 during transcoding (fixes #650)
There are codepoints in PDFDoc that are not valid UTF-8 but map to
valid UTF-8. We were handling those correctly with bidirectional
mapping.

However, if those same code points appeared in UTF-8, where they have
no meaning, they were left as fixed points when converting to PDFDoc,
where they do have meaning. This change recognizes them as errors.
2022-02-15 08:32:38 -05:00
Jay Berkenbilt
2b8d0f385b Prepare 10.6.1 release 2022-02-11 09:36:17 -05:00
Jay Berkenbilt
235c89e037 Fix one more PDF doc encoding error for 10.6 release (fixes #637) 2022-02-09 05:47:58 -05:00
Jay Berkenbilt
d6fe473029 Prepare 10.6.0 release 2022-02-08 16:54:03 -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
cfd5147d92 Add QPDF::getVersionAsPDFVersion 2022-02-08 12:34:14 -05:00
Jay Berkenbilt
8082af09be Add PDFVersion class 2022-02-08 12:34:14 -05:00
Jay Berkenbilt
dd4f30226f Rework PointerHolder transition to make it smoother
* Don't surprise people with deprecation warnings
* Provide detailed instructions and support for the transition
2022-02-07 17:38:20 -05:00
Jay Berkenbilt
cfaae47dc6 Add getBufferSharedPointer() to Pl_Buffer and QPDFWriter 2022-02-07 12:53:28 -05:00
Jay Berkenbilt
6a2456f732 Comment, ChangeLog, release note for new contribution 2022-02-06 11:27:02 -05:00
Jay Berkenbilt
eb481eb698 Prepare release notes for 10.6 (so far) 2022-02-05 15:41:22 -05:00
Jay Berkenbilt
dd3b2cedd3 Update ChangeLog for contributions from m-holger 2022-02-05 11:29:25 -05:00
Jay Berkenbilt
7fb22740e1 Add operator ""_qpdf for creating QPDFObjectHandle literals 2022-02-05 11:29:25 -05:00
Jay Berkenbilt
b48a0ff0e8 Add qpdf_empty_pdf to C API 2022-02-05 11:29:25 -05:00
Jay Berkenbilt
8cf7f2bfb5 API contract: qpdf_get_qpdf_version() returns a static 2022-02-05 11:24:56 -05:00
Jay Berkenbilt
5f3f78822b Improve use of std::unique_ptr
* Use unique_ptr in place of shared_ptr in some cases
* unique_ptr for arrays does not require a custom deleter
* use std::make_unique (c++14) where possible
2022-02-05 11:24:56 -05:00
Jay Berkenbilt
8eab616d62 Add qpdf version macros to qpdf/DLL.h 2022-02-04 13:41:01 -05:00
Jay Berkenbilt
9044a24097 PointerHolder: deprecate getPointer() and getRefcount()
Use get() and use_count() instead. Add #define
NO_POINTERHOLDER_DEPRECATION to remove deprecation markers for these
only.

This commit also removes all deprecated PointerHolder API calls from
qpdf's code except in PointerHolder's test suite, which must continue
to test the deprecated APIs.
2022-02-04 13:12:37 -05:00
Jay Berkenbilt
f727bc9443 PointerHolder: add get() and use_count() for forward compatibility
PointerHolder will be replaced with shared_ptr, so let people start
moving.
2022-02-04 13:12:37 -05:00
Jay Berkenbilt
956ecf2bc3 Remove duplicate ChangeLog entry 2022-02-04 07:43:39 -05:00
Jay Berkenbilt
2fd5a43f67 Add ChangeLog entries for refactoring work 2022-02-01 17:17:05 -05:00