Commit Graph

801 Commits

Author SHA1 Message Date
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
Jay Berkenbilt 5953116634 Clean up documentation and help around json options 2022-01-31 18:40:11 -05:00
Jay Berkenbilt e3506253f1 Add optional version to --json 2022-01-31 15:57:45 -05:00
Jay Berkenbilt 0364024781 Use QPDFUsage exception for cli, json, and QPDFJob errors 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 76c4f78b5c Add QUtil::make_shared_cstr
Replace most of the calls to QUtil::copy_string with this instead.
2022-01-30 13:11:03 -05:00
Jay Berkenbilt 8dea480c9f Allow optional fields in json "schema" checks 2022-01-30 13:11:03 -05:00
Jay Berkenbilt e8e8f6f43c Add JSON::parse 2022-01-30 13:11:03 -05:00
Jay Berkenbilt aa0a379b37 Add JSON::isDictionary and JSON::isArray 2022-01-30 13:11:03 -05:00
Jay Berkenbilt 823926f8bf Add ChangeLog for previous contribution 2022-01-22 09:16:55 -05:00
Jay Berkenbilt 370710657a Add missing characters from PDF doc encoding (fixes #606) 2022-01-11 15:55:19 -05:00
Jay Berkenbilt af91b5b584 Add QUtil::file_can_be_opened 2021-12-29 13:41:02 -05:00
Jay Berkenbilt eff911a94f Prepare 10.5.0 release (take 3) 2021-12-21 10:21:23 -05:00
Jay Berkenbilt 3772c34c62 Prepare 10.5.0 release (take 2) 2021-12-21 09:53:13 -05:00
Jay Berkenbilt 36916619f0 Stop adding pre-built documentation to the source distribution 2021-12-21 09:52:41 -05:00
Jay Berkenbilt e058247bcf Remove 10.5 release announcement since it hasn't been released yet 2021-12-21 07:23:01 -05:00
Jay Berkenbilt 04745320d6 Prepare 10.5.0 release 2021-12-20 14:51:46 -05:00
Jay Berkenbilt ea73bf72e0 Further improvements to handling binary strings 2021-12-19 14:30:45 -05:00
Jay Berkenbilt ddbe59179e C API: simplify new error handling and improve documentation 2021-12-17 15:59:47 -05:00
Jay Berkenbilt 59a64115a6 ChangeLog/doc for previous commit 2021-12-17 14:28:20 -05:00
Jay Berkenbilt feafcc4e88 C API: add several stream functions (fixes #596) 2021-12-17 13:28:11 -05:00
Jay Berkenbilt a0dbb71a64 Spell check 2021-12-17 12:38:52 -05:00
Jay Berkenbilt c40f8b5329 Make object types available to C API 2021-12-17 12:38:52 -05:00
Jay Berkenbilt fee7489ee4 Add Pl_Buffer::getMallocBuffer 2021-12-17 12:38:52 -05:00
Jay Berkenbilt 9bb6f570ec C API: add functions for working with pages (fixes #594) 2021-12-16 15:07:48 -05:00
Jay Berkenbilt 43740ea733 ChangeLog/release note on doc change 2021-12-13 11:20:14 -05:00
Jay Berkenbilt af2a71aa2c Handle bitstream overflow errors more gracefully (fixes #581)
* Make it a runtime error, not a logic error
* Include additional information
* Capture it properly in checkLinearization
2021-12-10 15:37:35 -05:00
Jay Berkenbilt 1c62c2a342 C API: expose functions for indirect objects (fixes #588) 2021-12-10 14:57:35 -05:00
Jay Berkenbilt 8e0b153332 Expose QPDFObjectHandle::addTokenFilter (fixes #580) 2021-12-10 13:37:07 -05:00
Jay Berkenbilt 72c10d8617 C API: overhaul error handling
* Handle error conditions that occur when using the object handle
  interfaces. In the past, some exceptions were not correctly
  converted to errors or warnings.
* Add more detailed information to qpdf-c.h
* Make it possible to work more explicitly with uninitialized objects
2021-12-10 12:16:02 -05:00
Jay Berkenbilt a144363653 Add changelog and release note for #587 2021-12-09 10:33:31 -05:00
Jay Berkenbilt e3cc171d02 C API: qpdf_oh_is_initialized 2021-12-09 10:33:31 -05:00
Jay Berkenbilt bef2c2222a C API: qpdf_get_last_string_length 2021-12-09 10:33:31 -05:00
Jay Berkenbilt ce7db05d22 Prepare 10.4.0 release 2021-11-16 15:44:09 -05:00
Jay Berkenbilt 88a4830015 Spell check 2021-11-16 15:15:48 -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 f45dacf4cb Make recovery logic flexible about where objects end (fixes #573)
Don't assume endobj is at the beginning of the line. This means we are
looking at tokens for every line, but the odds of n n obj appearing in
the middle of the object are likely much lower than endobj not being
at the beginning of the line or missing entirely. This will probably
have a negative impact on recovery time for very large files.
Hopefully it will be worth it.
2021-11-07 15:27:22 -05:00
Jay Berkenbilt 3794f8e2ad Support OpenSSL 3 (fixes #568) 2021-11-04 18:24:54 -04:00
Jay Berkenbilt a84a0b2487 Add range check in QPDFNumberTreeObjectHelper (fuzz issue 37740) 2021-11-04 14:03:24 -04:00
Jay Berkenbilt ec09b91443 Add QIntC::range_check_subtract 2021-11-04 13:53:46 -04:00
Jay Berkenbilt 4a648b9a00 Fix bug in merging resources /DR from foreign AcroForm (fixes #548)
When making resources indirect in from_dr, the code was using the
wrong owning QPDF, forgetting that from_dr had already been copied
using CopyForeignObject.
2021-11-04 12:29:42 -04: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 33a47d5c3c Make QPDF::findPage public (fixes #516)
This was originally not public because I wanted to get rid fo the
pages cache, but I recently realized there were deep reasons not to do
that, and the author of pikepdf wanted this, so I decided to make it
public.
2021-11-03 09:43:17 -04:00
Jay Berkenbilt 532a4f3d60 Detect recoverable but invalid zlib data streams (fixes #562) 2021-11-03 09:43:17 -04:00
Jay Berkenbilt 7ed991343b Better diagnostics when --pages is not closed (fixes #555) 2021-11-02 16:22:37 -04:00
Jay Berkenbilt 1b59872b36 Switch spelling checker to cspell 2021-09-13 11:10:09 -04:00
Jay Berkenbilt df38fe8e48 Fix string bounds checking in completion code (fixes #441) 2021-05-13 13:06:58 -04:00
Jay Berkenbilt 3cacb27a90 Performance fix on preserveObjectStreams 2021-05-09 07:51:14 -04:00
Jay Berkenbilt bddebdb0ea Prepare 10.3.2 release 2021-05-08 10:41:14 -04:00
Jay Berkenbilt b152b3c9a9 Include manuals in windows distributions again (fixes #521) 2021-05-08 09:42:18 -04:00
Jay Berkenbilt 30ac51bc78 Exclude unreferenced objects in object streams (fixes #520) 2021-05-08 09:42:09 -04:00
Jay Berkenbilt 36c7c20819 Fix timezone portability issue (fixes #515) 2021-04-17 18:12:55 -04:00
Jay Berkenbilt 8971443e46 QPDF::addPage*: handle duplicate pages more robustly 2021-04-05 10:58:10 -04:00
Jay Berkenbilt 3f05429cc5 Prepare 10.3.1 release 2021-03-11 12:59:41 -05:00
Jay Berkenbilt 85884c363c Allow /DR to be direct in /AcroForm
Also handle direct annotation, though this is much less likely.
2021-03-11 11:43:38 -05:00
Jay Berkenbilt dc65b88457 Prepare 10.3.0 release 2021-03-05 06:15:48 -05:00
Jay Berkenbilt 0b77f2cf26 Revert non-binary-compatible handleWarning change -- see TODO (ABI) 2021-03-04 15:59:46 -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 a2124f992c Add QPDFMatrix::operator== 2021-03-04 15:08:36 -05:00
Jay Berkenbilt d7ffdfa994 Add optional conflict detection to mergeResources
Also improve behavior around direct vs. indirect resources.
2021-03-04 15:08:36 -05:00
Jay Berkenbilt e17585c2d2 Remove unreferenced: ignore names that are not Fonts or XObjects
Converted ResourceFinder to ParserCallbacks so we can better detect
the name that precedes various operators and use the operators to sort
the names into resource types. This enables us to be smarter about
detecting unreferenced resources in pages and also sets the stage for
reconciling differences in /DR across documents.
2021-03-03 17:05:49 -05:00
Jay Berkenbilt a15ec6967d Enhancements to ParserCallbacks 2021-03-03 17:05:49 -05:00
Jay Berkenbilt 1bb209a9bf Add QPDF::numWarnings 2021-03-03 17:05:49 -05:00
Jay Berkenbilt fa2516df71 Fix behavior for finding /Q, /DA, and /DR for form fields
If not found in the field hierarchy, /Q and /DA are supposed to be
looked up in the document-level form dictionary. /DR is supposed to
only come from the document dictionary.
2021-03-03 17:05:19 -05:00
Jay Berkenbilt 3bdefb4c2d Update examples to use copyStream() 2021-02-25 13:21:23 -05:00
Jay Berkenbilt 0f0f60109b Add missing release entry in ChangeLog 2021-02-25 11:46:04 -05:00
Jay Berkenbilt a4d6589ff2 Have QPDFObjectHandle notice when replaceObject was called
This results in a performance penalty of 1% to 2% when replaceObject
and swapObjects are never called and a somewhat larger penalty if they
are called, but it's worth it to avoid very confusing behavior as
discussed in depth in qpdf#507.
2021-02-25 07:32:46 -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 83216e640c Preserve form fields when splitting pages (fixes #340) 2021-02-22 18:42:06 -05:00
Jay Berkenbilt 1f35ec9988 Add methods for copying form fields 2021-02-22 18:42:06 -05:00
Jay Berkenbilt f02aa74bf5 Update pdf-overlay-page example to copy annotations 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 a76decd2d5 Add QPDFObjGen::unparse 2021-02-21 16:21:52 -05:00
Jay Berkenbilt 92fbc6fdf5 QPDFObjectHandle::copyStream 2021-02-21 06:36:30 -05:00
Jay Berkenbilt 901f1a788c Enhance QPDFMatrix API 2021-02-21 06:36:30 -05:00
Jay Berkenbilt 35dd11f356 Allow --rotate=0 2021-02-20 16:29:34 -05:00