summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-01-25 12:55:31 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-26 04:30:05 +0100
commit009767d97a0dfebbb9bb71efb4b894b25fb59dd8 (patch)
tree6c10e6a67ecee41f511d06e88626f10bb737106a /include
parent2d32f4db8fd125f2481ecf767d9f6506e80481f6 (diff)
downloadqpdf-009767d97a0dfebbb9bb71efb4b894b25fb59dd8.tar.zst
Handle inheritable page attributes
Add getAttribute for handling inheritable page attributes, and fix getPageImages and annotation flattening code to use it.
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDFPageObjectHelper.hh21
1 files changed, 15 insertions, 6 deletions
diff --git a/include/qpdf/QPDFPageObjectHelper.hh b/include/qpdf/QPDFPageObjectHelper.hh
index e17453fa..eb72f7aa 100644
--- a/include/qpdf/QPDFPageObjectHelper.hh
+++ b/include/qpdf/QPDFPageObjectHelper.hh
@@ -39,13 +39,22 @@ class QPDFPageObjectHelper: public QPDFObjectHelper
{
}
+ // Return the effective value of this attribute for the page. If
+ // the requested attribute is not present on the page but is
+ // inheritable, look up through the page's ancestors in the page
+ // tree. If copy_if_shared is true, then this method will replace
+ // the attribute with a shallow copy if it is in indirect or
+ // inherited and return the copy. You should do this if you are
+ // going to modify the returned object and want the modifications
+ // to apply to the current page only.
+ QPDF_DLL
+ QPDFObjectHandle
+ getAttribute(std::string const& name, bool copy_if_shared);
+
// Returns an empty map if there are no images or no resources.
- // This function does not presently support inherited resources.
- // If this is a significant concern, call
- // pushInheritedAttributesToPage() on the QPDF object that owns
- // this page. See comment in the source for details. Return value
- // is a map from XObject name to the image object, which is always
- // a stream.
+ // Prior to qpdf 8.4.0, this function did not support inherited
+ // resources, but it does now. Return value is a map from XObject
+ // name to the image object, which is always a stream.
QPDF_DLL
std::map<std::string, QPDFObjectHandle> getPageImages();