aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFWriter.cc
AgeCommit message (Collapse)Author
2017-08-22Push QPDFWriter member variables into a nested classJay Berkenbilt
2017-08-22Improve pclm parameter settingsJay Berkenbilt
2017-08-22Combine writePCLm with writeStandardJay Berkenbilt
Reduce code duplication
2017-08-22Combine PCLm header into writeHeaderJay Berkenbilt
2017-08-22Remove duplicated coverage casesJay Berkenbilt
Remove duplicated coverage cases from Sahil's code so existing test suite passes.
2017-08-22QPDFWriter: Add setPCLm() and writePCLm() methodsSahil Arora
* Add support for PCLm using setPCLm() and writePCLm() methods in QPDFWriter.hh and QPDFWriter.cc * Add a function writePCLmHeader() for PCLm header in QPDFWriter
2017-08-21Precheck streams by defaultJay Berkenbilt
There is no need for a --precheck-streams option. We can do the precheck without imposing any penalty, only re-encoding the stream if it fails the first time.
2017-08-21Enable finer grained control of stream decodingJay Berkenbilt
This commit adds several API methods that enable control over which types of filters QPDF will attempt to decode. It also adds support for /RunLengthDecode and /DCTDecode filters for both encoding and decoding.
2017-08-12Fix infinite loop in QPDFWriter (fixes #143)Jay Berkenbilt
2017-08-12Fix --newline-before-endstream option (fixes #133)Jay Berkenbilt
Add a newline unconditionally before endstream even if a newline was already written as part of the stream data.
2017-08-12Prevent a division by zero error (fixes #141)Jay Berkenbilt
Bad /W in an xref stream could cause a division by zero error. Now this is handled as a special case.
2017-07-29Add newline-before-endstream option (fixes #103)Jay Berkenbilt
2017-07-29Fix exception catchJay Berkenbilt
2017-07-29Add option to preserve unreferenced objectsJay Berkenbilt
2017-07-28Add precheck streams capabilityJay Berkenbilt
When requested, QPDFWriter will do more aggress prechecking of streams to make sure it can actually succeed in decoding them before attempting to do so. This will allow preservation of raw data even when the raw data is corrupted relative to the specified filters.
2015-11-10Remove some ABI compatibility private methodsJay Berkenbilt
Since we have to bump soname, remove some private methods that were just there for binary compatibility
2015-10-31Implement deterministic IDJay Berkenbilt
For non-encrypted files, determinstic ID generation uses file contents instead of timestamp and file name. At a small runtime cost, this enables generation of the same /ID if the same inputs are converted in the same way multiple times.
2014-06-07Handle indirect stream filter/decode parametersJay Berkenbilt
QPDFWriter was trying to make /Filter and /DecodeParms direct in all cases, but there are some cases where /DecodeParms may refer to a stream, which can't be direct. QPDFWriter doesn't actually need /DecodeParms to be direct in that case because it won't be able to filter the stream. Until we can handle this type of stream, just don't make /Filter and /DecodeParms direct if we can't filter the stream anyway. Fixes #34
2014-02-23Fix calculation of xref stream stream columnsJay Berkenbilt
Fix problem: if the last object in the first part of a linearized file had an offset that was below 65536 by less than the size of the hint stream, the xref stream was invalid and the resulting file is not usable.
2013-12-14Comments about incremental update supportJay Berkenbilt
Also remove some trivial, non-functional code.
2013-11-29Include <algorithm> for std::min, std::maxJay Berkenbilt
2013-10-18Warn when -accessibility=n will be ignoredJay Berkenbilt
Also accept -accessibility=n with 256 bit keys even though it will be ignored.
2013-10-18Security: replace operator[] with atJay Berkenbilt
For std::string and std::vector, replace operator[] with at. This was done using an automated process. See README.hardening for details.
2013-10-10Replace some assertions with std::logic_errorJay Berkenbilt
Ideally, the library should never call assert outside of test code, but it does in several places. For some cases where the assertion might conceivably fail because of a problem with the input data, replace assertions with exceptions so that they can be trapped by the calling application. This commit surely misses some cases and replaced some cases unnecessarily, but it should still be an improvement.
2013-07-10Change API/ABI and withdraw 4.2.0Jay Berkenbilt
4.2.0 was binary incompatible in spite of there being no deletions or changes to any public methods. As such, we have to bump the ABI and are fixing some API breakage while we're at it. Previous 4.3.0 target is now 5.1.0.
2013-07-07Fix errors reported by CoverityJay Berkenbilt
Thanks to Jiri Popelka from Red Hat for sending the output of a Coverity run over qpdf.
2013-06-15Add optional /Length key in crypt filter dictionaryJay Berkenbilt
2013-06-14Bug fix: handle generation > 0 when generating object streamsJay Berkenbilt
Rework QPDFWriter to always track old object IDs and QPDFObjGen instead of int, thus not discarding the generation number. Switch to QPDF::getCompressibleObjGen() to properly handle the case of an old object eligible for compression that has a generation of other than zero.
2013-06-09Remove duplicated commentJay Berkenbilt
2013-03-05Call QUtil::safe_fopen in place of fopenJay Berkenbilt
fopen was previuosly called wrapped by QUtil::fopen_wrapper, but QUtil::safe_fopen does this itself, which is less cumbersome.
2013-03-05Mark secure CRT warnings with commentJay Berkenbilt
Put a specific comment marker next to every piece of code that MSVC gives warning 4996 for. This warning is generated for calls to functions that Microsoft considers insecure or deprecated. This change is in preparation for fixing all these cases even though none of them are actually incorrect or insecure as used in qpdf. The comment marker makes them easier to find so they can be fixed in subsequent commits.
2013-03-04Remove all old-style casts from C++ codeJay Berkenbilt
2012-12-31Avoid modifying trailer when writingJay Berkenbilt
When preparing the trailer for writing to the new file, trim a copy of the trailer instead of the original file's trailer.
2012-12-31Remove /Crypt from stream filters unconditionallyJay Berkenbilt
When writing a new stream, always remove /Crypt even if we are not otherwise able to filter the stream.
2012-12-31Refactor Dictionary writing codeJay Berkenbilt
Original code was written before we could shallow copy objects, so all the filtering was done by suppressing the output of certain keys and replacing them with other keys. Now we can simplify the code greatly by modifying shallow copies of dictionaries in place.
2012-12-31Support for encryption with /V=5 and /R=5 and /R=6Jay Berkenbilt
Read and write support is implemented for /V=5 with /R=5 as well as /R=6. /R=5 is the deprecated encryption method used by Acrobat IX. /R=6 is the encryption method used by PDF 2.0 from ISO 32000-2.
2012-12-31Support files with only attachments encryptedJay Berkenbilt
Test cases added in a future commit since they depend on /R=6 support.
2012-12-31Update AES classes to work with 256-bit keysJay Berkenbilt
2012-12-31Add ExtensionLevel support to version handlingJay Berkenbilt
All version operations are now fully aware of extension levels.
2012-12-31Add V5 parameters to EncryptionDataJay Berkenbilt
2012-12-31Eliminate flattenScalarReferencesJay Berkenbilt
2012-09-23Allow reading from InputSource and writing to PipelineJay Berkenbilt
Allowing users to subclass InputSource and Pipeline to read and write from/to arbitrary sources provides the maximum flexibility for users who want to read and write from other than files or memory.
2012-09-06Add QPDFWriter::setExtraHeaderTextJay Berkenbilt
2012-09-06Fix segmentation fault with use of QPDFWriter::setOutputMemoryJay Berkenbilt
2012-07-16Minor fixes to copyEncryptionParametersJay Berkenbilt
This fixes were to code added yesterday; the problems would not have impacted any previously released code. These are all changes related to the possibility that copyEncryptionParameters may be called on behalf a different QPDF than the one being written.
2012-07-16Bug fix: preserve AES when copying encryption parametersJay Berkenbilt
2012-07-14Add public QPDFWriter::copyEncryptionParametersJay Berkenbilt
Method to copy encryption parameters from another file. Adapted from existing code to copy encryption parameters from the original file.
2012-07-14Have QPDFWriter detect foreign objects while writingJay Berkenbilt
Throw an exception that directs the user to QPDF::copyForeignObject.
2012-07-06Add QPDFWriter method to output to FILE*Jay Berkenbilt
2012-06-25Fix large file support for 32-bit LinuxJay Berkenbilt