2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-25 23:02:38 +00:00
Commit Graph

148 Commits

Author SHA1 Message Date
Jay Berkenbilt
8d2b29ef98 Fix segmentation fault with use of QPDFWriter::setOutputMemory 2012-09-06 14:39:06 -04:00
Jay Berkenbilt
3c4110184c Add specially crafted test cases for EOF error
This replaces a PDF from the wild that I didn't want to include in the
test suite but used to verify the original fix.
2012-08-11 12:36:57 -04:00
Jay Berkenbilt
29e9c34fe3 Bug fix: let EOF resolve literal token
Previously only whitespace and comments did it.  This fix is needed
for object streams whose last object is a literal (name, integer,
real, string) not terminated by space or newline.
2012-08-11 09:29:04 -04:00
Jay Berkenbilt
32051283b9 Fix spelling errors 2012-07-29 14:44:12 -04:00
Jay Berkenbilt
bde98044f4 Improve password handling
Use --encryption-file-password, if given, in addition to --password as
a source for passwords for files specified in --pages.
2012-07-29 13:22:37 -04:00
Jay Berkenbilt
f83bddf882 Update copyright to 2012 2012-07-28 22:03:36 -04:00
Jay Berkenbilt
2280c4f6d1 Update documentation and version numbers
3.0.rc1
2012-07-28 22:03:36 -04:00
Jay Berkenbilt
5878d17f0d Add QPDF_ to some variables used by the test suite
LARGE_FILE_TEST_PATH -> QPDF_LARGE_FILE_TEST_PATH
SKIP_TEST_COMPARE_IMAGES -> QPDF_SKIP_TEST_COMPARE_IMAGES
2012-07-28 19:07:37 -04:00
Jay Berkenbilt
d2e8bae6a4 Mention page selection in basic options 2012-07-28 15:02:20 -04:00
Jay Berkenbilt
f689324214 Restore coverage case
Previous commit lost coverage case for buffer-based replaceStreamData.
2012-07-25 22:32:14 -04:00
Jay Berkenbilt
316328704b Windows compilation fixes 2012-07-21 20:51:56 -04:00
Jay Berkenbilt
5a02471bb1 Command-line page merging and splitting
Implement --pages ... -- option for qpdf.  Update TODO with remaining
things to document.
2012-07-21 20:33:33 -04:00
Jay Berkenbilt
6bbea4baa0 Implement QPDFObjectHandle::parse
Move object parsing code from QPDF to QPDFObjectHandle and
parameterize the parts of it that are specific to a QPDF object.
Provide a version that can't handle indirect objects and that can be
called on an arbitrary string.

A side effect of this change is that the offset used when reporting
invalid stream length has changed, but since the new value seems like
a better value than the old one, the test suite has been updated
rather than making the code backward compatible.  This only effects
the offset reported for invalid streams that lack /Length or have an
invalid /Length key.

Updated some test code and exmaples to use QPDFObjectHandle::parse.

Supporting changes include adding a BufferInputSource constructor that
takes a string.
2012-07-21 09:06:10 -04:00
Jay Berkenbilt
a101533e0a Add command line option to copy encryption from other file
Add --copy-encryption and --encryption-file-password options to qpdf.
Also strengthen test suite for copying encryption.  The strengthened
test suite would have caught the failure to preserve AES and the
failure to update the file version, which was invalidating the
encrypted data.
2012-07-15 21:15:24 -04:00
Jay Berkenbilt
db95960ac1 Bug fix: preserve AES when copying encryption parameters 2012-07-15 19:07:59 -04:00
Jay Berkenbilt
b501251291 qpdf: push inherited attributes to page when showing images
from qpdf command-line tool
2012-07-15 16:22:28 -04:00
Jay Berkenbilt
0575d77d77 Add public QPDFWriter::copyEncryptionParameters
Method to copy encryption parameters from another file.  Adapted from
existing code to copy encryption parameters from the original file.
2012-07-14 09:14:41 -04:00
Jay Berkenbilt
ee3682f106 test_driver: accept optional second file name
This way we don't have to hard-code the name of a second file in the
test driver for tests that require one.
2012-07-14 08:48:30 -04:00
Jay Berkenbilt
1c944e4c89 Have QPDFWriter detect foreign objects while writing
Throw an exception that directs the user to QPDF::copyForeignObject.
2012-07-14 08:07:23 -04:00
Jay Berkenbilt
e7b8f297ba Support copying objects from another QPDF object
This includes QPDF::copyForeignObject and supporting foreign objects
as arguments to addPage*.
2012-07-11 15:54:33 -04:00
Jay Berkenbilt
8a217eb3a2 Add concept of reserved objects
QPDFObjectHandle::{new,is,assert}Reserved, QPDF::replaceReserved
provide a mechanism to add objects to a PDF file when there are
circular references.  This is a prerequisite to copying objects from
one PDF to another.
2012-07-10 23:34:32 -04:00
Jay Berkenbilt
43d4f79352 Fix typo in variable name 2012-07-10 23:17:26 -04:00
Jay Berkenbilt
b9aded1a00 Favor string-based newStream method 2012-07-10 23:17:26 -04:00
Jay Berkenbilt
e2dedde4bd Don't require stream data provider to know length in advance
Breaking API change: length parameter has disappeared from the
StreamDataProvider version of QPDFObjectHandle::replaceStreamData
since it is no longer necessary to compute it in advance.  This
breaking change is justified by the fact that removing the length
parameter provides the caller an opportunity to simplify the calling
code.
2012-07-07 17:33:45 -04:00
Jay Berkenbilt
8705e2e8fc Add QPDFWriter method to output to FILE* 2012-07-05 21:24:04 -04:00
Jay Berkenbilt
3b5d72b946 Remove stray comment 2012-07-05 13:28:21 -04:00
Jay Berkenbilt
c227249ef1 Added test code for Tobias's changes 2012-07-04 23:19:32 -04:00
Tobias Hoffmann
abb53ac369 Limited inheritance to the attributes explicitly listed in the PDF spec
Previous versions of qpdf incorrectly passed arbitrary objects from
/Pages objects down to individual pages in direct contradition with
the PDF specification.  These are now left in /Pages.  When
intermediate /Pages nodes are being discarded as when the /Pages tree
is being flattened, a warning is issued when unknown keys are
encountered.
2012-07-04 23:04:55 -04:00
Jay Berkenbilt
5f59c32f87 Add a few minor enhancements to recent work
Test coverage case for new newStream method
Expose decimal_places argument for double-based newReal

All enhancements suggested by Tobias.
2012-06-27 10:43:27 -04:00
Tobias Hoffmann
43c404b45a Add QPDFObjectHandle::newStream(QPDF *, std::string const&)
This makes the code simpler than having to create a buffer of a fixed
size and copy the string to it.
2012-06-27 10:19:57 -04:00
Jay Berkenbilt
736bafbb9c Rename seek functions in QUtil 2012-06-26 23:10:10 -04:00
Jay Berkenbilt
df3c762600 Fix Windows compilation issue 2012-06-25 21:01:55 -04:00
Jay Berkenbilt
1a3e88ca09 Fix large file support for 32-bit Linux 2012-06-25 10:51:44 -04:00
Jay Berkenbilt
c16db4106c Increase padding in linearized files
With QPDF allowing integers to contain 64-bit quantities, this change
is necessary to be able to linearize files whose sizes might be larger
than 10 digits.
2012-06-24 15:56:59 -04:00
Jay Berkenbilt
8318d81ada Fix and test support for files >= 4 GB 2012-06-24 15:56:50 -04:00
Jay Berkenbilt
2a057ac0d4 Add test case for removing a page we don't have 2012-06-23 18:32:14 -04:00
Jay Berkenbilt
4f305488d8 Improve the FILE* version of QPDF::processFile 2012-06-23 18:23:06 -04:00
Jay Berkenbilt
6c0af0844c Switch some code to use empty newArray/newDictionary 2012-06-22 10:09:42 -04:00
Jay Berkenbilt
b6bdc0f595 Add factory methods for creating empty arrays and dictionaries.
Also updated pdf_from_scratch test driver to use the new factories,
and made some cosmetic improvements and documentation updates for the
emptyPDF() method.
2012-06-22 09:46:33 -04:00
Jay Berkenbilt
a0768e4190 Add QPDF::emptyPDF() and pdf_from_scratch test code 2012-06-21 23:09:05 -04:00
Jay Berkenbilt
d1ebe30ff6 Add QPDFObjectHandle::shallowCopy() 2012-06-21 16:15:09 -04:00
Jay Berkenbilt
1b364ad7b8 Add additional page API test cases 2012-06-21 15:27:32 -04:00
Jay Berkenbilt
3844aedd93 Add testing for page APIs 2012-06-21 15:01:02 -04:00
Jay Berkenbilt
eb802cfa8c Implement page manipulation APIs 2012-06-21 15:01:02 -04:00
Jay Berkenbilt
bc1c4bb578 Add QPDF::processFile that takes an open FILE* 2012-06-21 08:00:35 -04:00
Jay Berkenbilt
91d175452d Add testing for new array mutators 2012-06-20 15:29:44 -04:00
Jay Berkenbilt
5d4cad9c02 ABI change: fix use of off_t, size_t, and integer types
Significantly improve the code's use of off_t for file offsets, size_t
for memory sizes, and integer types in cases where there has to be
compatibility with external interfaces.  Rework sections of the code
that would have prevented qpdf from working on files larger than 2 (or
maybe 4) GB in size.
2012-06-20 15:20:26 -04:00
Jay Berkenbilt
81fc594342 Remove extraneous execute bits 2012-06-20 15:18:08 -04:00
Jay Berkenbilt
22f5b01f54 Fix documentation errors. 2011-12-28 14:17:59 -05:00
Jay Berkenbilt
5963267b5f Discard stderr from gs when comparing images.
This works around cases where gs falsely complains about things in the
PDF files or gives warnings that don't harm the output.  See comments
in qpdf.test for details.
2011-12-28 14:02:07 -05:00