aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFPageDocumentHelper.cc
AgeCommit message (Collapse)Author
2022-05-21Code clean up: use range-style for loops wherever possiblem-holger
Remove variables obsoleted by commit 4f24617.
2022-04-30Code clean up: use range-style for loops wherever possibleJay Berkenbilt
Where not possible, use "auto" to get the iterator type. Editorial note: I have avoid this change for a long time because of not wanting to make gratuitous changes to version history, which can obscure when certain changes were made, but with having recently touched every single file to apply automatic code formatting and with making several broad changes to the API, I decided it was time to take the plunge and get rid of the older (pre-C++11) verbose iterator syntax. The new code is just easier to read and understand, and in many cases, it will be more effecient as fewer temporary copies are being made. m-holger, if you're reading, you can see that I've finally come around. :-)
2022-04-16Use = default and = delete where possible in classesJay Berkenbilt
2022-04-04Programmatically apply new formatting to codeJay Berkenbilt
Run this: for i in **/*.cc **/*.c **/*.h **/*.hh; do clang-format < $i >| $i.new && mv $i.new $i done
2022-02-05Add operator ""_qpdf for creating QPDFObjectHandle literalsJay Berkenbilt
2022-02-04Add a blank line after the first header included in each sourceJay Berkenbilt
2021-03-03Fix behavior for finding /Q, /DA, and /DR for form fieldsJay Berkenbilt
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.
2019-06-21Fix sign and conversion warnings (major)Jay Berkenbilt
This makes all integer type conversions that have potential data loss explicit with calls that do range checks and raise an exception. After this commit, qpdf builds with no warnings when -Wsign-conversion -Wconversion is used with gcc or clang or when -W3 -Wd4800 is used with MSVC. This significantly reduces the likelihood of potential crashes from bogus integer values. There are some parts of the code that take int when they should take size_t or an offset. Such places would make qpdf not support files with more than 2^31 of something that usually wouldn't be so large. In the event that such a file shows up and is valid, at least qpdf would raise an error in the right spot so the issue could be legitimately addressed rather than failing in some weird way because of a silent overflow condition.
2019-01-27Add QPDFObjectHandle::getUniqueResourceNameJay Berkenbilt
2019-01-26Handle inheritable page attributesJay Berkenbilt
Add getAttribute for handling inheritable page attributes, and fix getPageImages and annotation flattening code to use it.
2019-01-21When flattening, remove annotations with no appearance streamJay Berkenbilt
With the exception of form field annotations when /NeedAppearances is true, remove annotations that don't have appearance streams when flattening. There is no reason to keep these when flattening since they are invisible. This may include unchecked checkboxes, unshown popup windows, etc.
2019-01-03Honor flags when flattening annotationsJay Berkenbilt
2019-01-03Minor fixesJay Berkenbilt
2019-01-03Switch annotation flattening to use the form xobjectsJay Berkenbilt
Instead of directly putting the contents of the annotation appearance streams into the page's content stream, add commands to render the form xobjects directly. This is a more robust way to do it than the original solution as it works properly with patterns and avoids problems with resource name clashes between the pages and the form xobjects.
2019-01-01Annotation flattening including form fieldsJay Berkenbilt
Flatten annotations by integrating their appearance streams into the content stream of the containing page. In the case of form fields, only flatten if /NeedAppearance is false (or equivalently absent). If flattening form fields, also remove /AcroForm from the document catalog.
2018-06-22When splitting files, remove unreferenced objects (fixes #203)Jay Berkenbilt
2018-06-21Add QPDFPageDocumentHelper and QPDFPageObjectHelperJay Berkenbilt
This is the beginning of higher-level API support using helper classes. The goal is to be able to add more helpers without continuing to pollute QPDF's and QPDFObjectHandle's public interfaces.