aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFPageObjectHelper.cc
AgeCommit message (Collapse)Author
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
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.