diff options
author | Jay Berkenbilt <ejb@ql.org> | 2019-01-25 12:55:31 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2019-01-26 04:30:05 +0100 |
commit | 009767d97a0dfebbb9bb71efb4b894b25fb59dd8 (patch) | |
tree | 6c10e6a67ecee41f511d06e88626f10bb737106a /libqpdf/QPDFPageDocumentHelper.cc | |
parent | 2d32f4db8fd125f2481ecf767d9f6506e80481f6 (diff) | |
download | qpdf-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 'libqpdf/QPDFPageDocumentHelper.cc')
-rw-r--r-- | libqpdf/QPDFPageDocumentHelper.cc | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/libqpdf/QPDFPageDocumentHelper.cc b/libqpdf/QPDFPageDocumentHelper.cc index fa50c471..3eec789b 100644 --- a/libqpdf/QPDFPageDocumentHelper.cc +++ b/libqpdf/QPDFPageDocumentHelper.cc @@ -79,20 +79,12 @@ QPDFPageDocumentHelper::flattenAnnotations( "document does not have updated appearance streams," " so form fields will not be flattened"); } - pushInheritedAttributesToPage(); std::vector<QPDFPageObjectHelper> pages = getAllPages(); for (std::vector<QPDFPageObjectHelper>::iterator iter = pages.begin(); iter != pages.end(); ++iter) { QPDFPageObjectHelper ph(*iter); - QPDFObjectHandle page_oh = ph.getObjectHandle(); - if (page_oh.getKey("/Resources").isIndirect()) - { - QTC::TC("qpdf", "QPDFPageDocumentHelper indirect resources"); - page_oh.replaceKey("/Resources", - page_oh.getKey("/Resources").shallowCopy()); - } - QPDFObjectHandle resources = ph.getObjectHandle().getKey("/Resources"); + QPDFObjectHandle resources = ph.getAttribute("/Resources", true); if (! resources.isDictionary()) { // This should never happen and is not exercised in the |