diff options
author | Jay Berkenbilt <ejb@ql.org> | 2019-01-01 05:08:57 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2019-01-01 14:14:15 +0100 |
commit | 3b8ce4f12a75b34d890cb061a721e1a1240cddd1 (patch) | |
tree | 8975df54f2d487a6fd0e2bb78e607e8024b0c5b0 /include | |
parent | 95d6b17a8904b110c3625e66538368c433f48042 (diff) | |
download | qpdf-3b8ce4f12a75b34d890cb061a721e1a1240cddd1.tar.zst |
Annotation flattening including form fields
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.
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDFPageDocumentHelper.hh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/qpdf/QPDFPageDocumentHelper.hh b/include/qpdf/QPDFPageDocumentHelper.hh index 52e03be8..d5446c16 100644 --- a/include/qpdf/QPDFPageDocumentHelper.hh +++ b/include/qpdf/QPDFPageDocumentHelper.hh @@ -31,6 +31,8 @@ #include <qpdf/QPDF.hh> +class QPDFAcroFormDocumentHelper; + class QPDFPageDocumentHelper: public QPDFDocumentHelper { public: @@ -84,7 +86,21 @@ class QPDFPageDocumentHelper: public QPDFDocumentHelper QPDF_DLL void removePage(QPDFPageObjectHelper page); + // For every annotation, integrate the annotation's appearance + // stream into the containing page's content streams, merge the + // annotation's resources with the page's resources, and remove + // the annotation from the page. Handles widget annotations + // associated with interactive form fields as a special case, + // including removing the /AcroForm key from the document catalog. + QPDF_DLL + void flattenAnnotations(); + private: + void flattenAnnotationsForPage( + QPDFPageObjectHelper& page, + QPDFObjectHandle& resources, + QPDFAcroFormDocumentHelper& afdh); + class Members { friend class QPDFPageDocumentHelper; |