summaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFWriter.cc
AgeCommit message (Collapse)Author
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
2012-06-24Increase padding in linearized filesJay Berkenbilt
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-24Fix and test support for files >= 4 GBJay Berkenbilt
2012-06-24Change QPDF_Integer from int to long longJay Berkenbilt
This makes it possible to store offsets that are larger than 2 GB in the trailer dictionary.
2012-06-23Replace the 8-bit characters with \x.. in QPDFWriter.ccJay Berkenbilt
This just makes it safer to pull up this file in an editor.
2012-06-22Use qpdf_offset_t in place of off_t in public APIs.Jay Berkenbilt
off_t is used internally only when needed to talk to standard libraries. This requires that the "long long" type be supported by the compiler.
2012-06-21Iterate of /Info's keys, not trailer's keys, to seed /IDJay Berkenbilt
Thanks Tobias Hoffmann for noticing the error.
2012-06-20ABI change: fix use of off_t, size_t, and integer typesJay Berkenbilt
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-20Fix gcc 4.7 warnings about C++11Jay Berkenbilt
2011-08-11fix small logic error surrounding adding newlines; in practice, the logic ↵Jay Berkenbilt
error would probably never manifest itself without other code changes
2011-08-11fix memory error caught by valgrindJay Berkenbilt
2011-08-11remove stray XXX commentJay Berkenbilt
2011-08-11preserve /EncryptMetadata when copying encryption parametersJay Berkenbilt
2011-08-10implement ability to save PDF to memory, also update ChangeLogJay Berkenbilt
2011-08-10implement replace and swapJay Berkenbilt
2010-09-24update code to new PointerHolder, and reintroduce change that was ↵Jay Berkenbilt
accidentally backed out git-svn-id: svn+q:///qpdf/trunk@1031 71b93d88-0707-0410-a8cf-f5a4172ac649
2010-09-05handle stream filter abbreviations from table H.1Jay Berkenbilt
git-svn-id: svn+q:///qpdf/trunk@1025 71b93d88-0707-0410-a8cf-f5a4172ac649
2010-08-02typoJay Berkenbilt
git-svn-id: svn+q:///qpdf/trunk@985 71b93d88-0707-0410-a8cf-f5a4172ac649
2010-08-02remove use of float for version comparisonJay Berkenbilt
git-svn-id: svn+q:///qpdf/trunk@984 71b93d88-0707-0410-a8cf-f5a4172ac649
2010-04-19fix linearization padding bug for second xref stream as well as first, which ↵Jay Berkenbilt
was previously fixed git-svn-id: svn+q:///qpdf/trunk@957 71b93d88-0707-0410-a8cf-f5a4172ac649
2010-04-19refactor to isolate pad calculationJay Berkenbilt
git-svn-id: svn+q:///qpdf/trunk@956 71b93d88-0707-0410-a8cf-f5a4172ac649
2010-03-27comment about flattenScalarReferencesJay Berkenbilt
git-svn-id: svn+q:///qpdf/trunk@945 71b93d88-0707-0410-a8cf-f5a4172ac649
2010-01-24redo padding calculation for first half xref stream; old calculationJay Berkenbilt
failed to consider the effect of compressing the strema git-svn-id: svn+q:///qpdf/trunk@932 71b93d88-0707-0410-a8cf-f5a4172ac649