summaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFPageObjectHelper.cc
AgeCommit message (Collapse)Author
2022-02-08WHITESPACE ONLY -- expand tabs in source codeJay Berkenbilt
This comment expands all tabs using an 8-character tab-width. You should ignore this commit when using git blame or use git blame -w. In the early days, I used to use tabs where possible for indentation, since emacs did this automatically. In recent years, I have switched to only using spaces, which means qpdf source code has been a mixture of spaces and tabs. I have avoided cleaning this up because of not wanting gratuitous whitespaces change to cloud the output of git blame, but I changed my mind after discussing with users who view qpdf source code in editors/IDEs that have other tab widths by default and in light of the fact that I am planning to start applying automatic code formatting soon.
2022-02-07Update for clean compile with POINTERHOLDER_TRANSITION=2Jay Berkenbilt
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
2022-02-04PointerHolder: deprecate getPointer() and getRefcount()Jay Berkenbilt
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-01-27Remove some if statements and simplify some boolean expressionsm-holger
Use QPDFObjectHandle::isNameAndEquals, isDictionaryOfType and isStreamOfType.
2021-03-04Don't use handleWarning, which is being revertedJay Berkenbilt
2021-03-04Major rework of handling form fields when copying pages (fixes #509)Jay Berkenbilt
2021-03-03Remove unreferenced: ignore names that are not Fonts or XObjectsJay Berkenbilt
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-03Create ResourceFinder from NameWatcher in QPDFPageObjectHelperJay Berkenbilt
2021-02-23Remove warning that gives false positives in some normal casesJay Berkenbilt
2021-02-23Add new placeFormXObject that takes a matrix referenceJay Berkenbilt
2021-02-23Add copyAnnotations, use with overlay/underlay (fixes #395)Jay Berkenbilt
2021-02-21Add transformAnnotations and fix flattenRotations to use itJay Berkenbilt
2021-02-21Explicitly override inherited rotate in flattenRotationsJay Berkenbilt
2021-02-21Use QPDFMatrix inside flattenRotationsJay Berkenbilt
2021-02-18Add QPDFPageObjectHelper::getMatrixForFormXObjectPlacementJay Berkenbilt
2021-02-03Handle older PDFs whose form XObjects inherit resources (fixes #494)Jay Berkenbilt
When removing unreferenced resources, notice if a page (recursively) contains a form XObject with unreferenced resources, and count any such resources as referenced by the page.
2021-02-03Refactor removal of unreferenced resourcesJay Berkenbilt
Refactor in preparation for resolving unresolved resources in form xobjects from page.
2021-01-31Handle strings in inline image dictionariesJay Berkenbilt
We need to use token.getRawValue, not token.getValue
2021-01-31Recover from exceptions during filtering for inline imagesJay Berkenbilt
2021-01-04Spell checkJay Berkenbilt
2021-01-03Fix outdated commentJay Berkenbilt
2021-01-02Make more QPDFPageObjectHelper methods work with form XObjectJay Berkenbilt
2021-01-02Externalize inline images now includes form XObjectsJay Berkenbilt
2021-01-02Add several methods for working with form XObjects (fixes #436)Jay Berkenbilt
Make some more methods in QPDFPageObjectHelper work with form XObjects, provide forEach methods to walk through nested form XObjects, possibly recursively. This should make it easier to work with form XObjects from user code.
2021-01-02QPDFPageObjectHelper: filterPageContents -> filterContents + form XObjectJay Berkenbilt
2021-01-02QPDFPageObjectHelper: getPageImages -> getImagesJay Berkenbilt
2021-01-02QPDFPageObjectHelper::getPageImages: support form XObjectsJay Berkenbilt
2021-01-01Add QPDFObjectHandle::isFormXObjectJay Berkenbilt
2020-12-30Add QPDFPageObjectHelper::flattenRotation and --flatten-rotationJay Berkenbilt
2020-04-16Fix warnings reported by -Wshadow=local (fixes #431)Jay Berkenbilt
2020-04-04placeFormXObject: allow control of shrink/expand (fixes #409)Jay Berkenbilt
2020-04-03QPDFPageObjectHelper::placeFormXObject: use std::string const& (fixes #374)Jay Berkenbilt
2020-03-31Look in form XObjects when removing unreferenced resources (fixes #373)Jay Berkenbilt
If a page contains a form XObject, also filter the form XObject and remove its unreferenced resources.
2020-03-31Refactor QPDFPageObjectHelper::removeUnreferencedResources()Jay Berkenbilt
Refactor removeUnreferencedResources to prepare for filtering form XObjects.
2020-01-26Bug fix: handle ColorSpace lookup for inline images (fixes #392)Jay Berkenbilt
If the value of /CS in the inline image dictionary was is key in the page's /Resource -> /ColorSpace dictionary, properly resolve it by referencing the proper colorspace, and not just the name, in the external image dictionary.
2019-11-09Allow /P in encryption dictionary to be positive (fixes #382)Jay Berkenbilt
Even though this is disallowed by the spec, files like this have been encountered in the wild.
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-02-01Spell checkJay Berkenbilt
2019-02-01Make inline image token exactly contain the image dataJay Berkenbilt
Do not include the trailing EI, and handle cases where EI is not preceded by a delimiter. Such cases have been seen in the wild.
2019-01-31Externalize inline images (fixes #278)Jay Berkenbilt
2019-01-27Convert pages to form XObjectsJay Berkenbilt
Support conversion of pages to form XObjects and placement of form XObjects on pages.
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-17Additional checks for unreferenced resourcesJay Berkenbilt
Explicitly abandon removal of unreferenced resources if there are any lexical errors in the page's contents. This case always generated a warning, but it now also prevents removal of unreferenced resources, this strongly decreasing the likelihood of data loss.
2019-01-17Copy subdictionaries when removing resources (fixes #276)Jay Berkenbilt
When removing unreferenced resources, the code was copying the overall resource dictionaries but not the subdictionaries being modified. This was a "typo" in the code -- the comment clearly stated the need to do this, but the code replaced the dictionary with itself rather than with a shallow copy of itself.
2019-01-12Allow adding the same page more than once in --pages (fixes #272)Jay Berkenbilt
2018-06-22Don't prune resource dictionaries on errors or by requestJay Berkenbilt
If we are unable to filter a page's content streams, don't attempt to remove objects from the page's resource dictionary. Also provide a command line option to suppress resource removal in case we ever need this as a workaround for some bug or broken PDF files.
2018-06-22When splitting files, remove unreferenced objects (fixes #203)Jay Berkenbilt
2018-06-21Implement helper class for interactive formsJay Berkenbilt