diff options
author | Jay Berkenbilt <ejb@ql.org> | 2021-02-26 20:47:52 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2021-03-03 23:05:19 +0100 |
commit | fa2516df712aa59eb414933a912d30bb6fa1606e (patch) | |
tree | 776307a8d4e513e0a8bcd6fdb586a1b8b722fcd1 /include | |
parent | 5207c3da713f242506aeb4889b97ced362b13bdf (diff) | |
download | qpdf-fa2516df712aa59eb414933a912d30bb6fa1606e.tar.zst |
Fix behavior for finding /Q, /DA, and /DR for form fields
If not found in the field hierarchy, /Q and /DA are supposed to be
looked up in the document-level form dictionary. /DR is supposed to
only come from the document dictionary.
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDFFormFieldObjectHelper.hh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/qpdf/QPDFFormFieldObjectHelper.hh b/include/qpdf/QPDFFormFieldObjectHelper.hh index edb93df8..6052f2e3 100644 --- a/include/qpdf/QPDFFormFieldObjectHelper.hh +++ b/include/qpdf/QPDFFormFieldObjectHelper.hh @@ -121,12 +121,22 @@ class QPDFFormFieldObjectHelper: public QPDFObjectHelper // the field tree into account. Returns the empty string if the // default appearance string is not available (because it's // erroneously absent or because this is not a variable text - // field). + // field). If not found in the field hierarchy, look in /AcroForm. QPDF_DLL std::string getDefaultAppearance(); + // Return the default resource dictionary for the field. This + // comes not from the field but from the document-level /AcroForm + // dictionary. While several PDF generates put a /DR key in the + // form field's dictionary, experimentation suggests that many + // popular readers, including Adobe Acrobat and Acrobat Reader, + // ignore any /DR item on the field. + QPDF_DLL + QPDFObjectHandle getDefaultResources(); + // Return the quadding value, taking inheritance from the field - // tree into account. Returns 0 if quadding is not specified. + // tree into account. Returns 0 if quadding is not specified. Look + // in /AcroForm if not found in the field hierarchy. QPDF_DLL int getQuadding(); @@ -200,6 +210,7 @@ class QPDFFormFieldObjectHelper: public QPDFObjectHelper void generateAppearance(QPDFAnnotationObjectHelper&); private: + QPDFObjectHandle getFieldFromAcroForm(std::string const& name); void setRadioButtonValue(QPDFObjectHandle name); void setCheckBoxValue(bool value); void generateTextAppearance(QPDFAnnotationObjectHelper&); |