aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFAnnotationObjectHelper.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-01-02 03:27:18 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-04 05:18:13 +0100
commite3144ac4177b7c38567f41a8e31a6c162d3b76f4 (patch)
tree94d2e557359b040cae83224a9c5e33f7cb46d7db /libqpdf/QPDFAnnotationObjectHelper.cc
parent26393f51373d95bb2fe5a99d1de9d04d8d7eb920 (diff)
downloadqpdf-e3144ac4177b7c38567f41a8e31a6c162d3b76f4.tar.zst
Add form fields to json output
Also add some additional methods for detecting form field types to assist in the json creation and for later use.
Diffstat (limited to 'libqpdf/QPDFAnnotationObjectHelper.cc')
-rw-r--r--libqpdf/QPDFAnnotationObjectHelper.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/libqpdf/QPDFAnnotationObjectHelper.cc b/libqpdf/QPDFAnnotationObjectHelper.cc
index 3295fd3a..5e4be795 100644
--- a/libqpdf/QPDFAnnotationObjectHelper.cc
+++ b/libqpdf/QPDFAnnotationObjectHelper.cc
@@ -49,6 +49,13 @@ QPDFAnnotationObjectHelper::getAppearanceState()
return "";
}
+int
+QPDFAnnotationObjectHelper::getFlags()
+{
+ QPDFObjectHandle flags_obj = this->oh.getKey("/F");
+ return flags_obj.isInteger() ? flags_obj.getIntValue() : 0;
+}
+
QPDFObjectHandle
QPDFAnnotationObjectHelper::getAppearanceStream(
std::string const& which,
@@ -169,13 +176,11 @@ QPDFAnnotationObjectHelper::getPageContentForAppearance(
// appearance matrix.
QPDFObjectHandle rect_obj = this->oh.getKey("/Rect");
- QPDFObjectHandle flags_obj = this->oh.getKey("/F");
QPDFObjectHandle as = getAppearanceStream("/N").getDict();
QPDFObjectHandle bbox_obj = as.getKey("/BBox");
QPDFObjectHandle matrix_obj = as.getKey("/Matrix");
- int flags = flags_obj.isInteger() ? flags_obj.getIntValue() : 0;
-
+ int flags = getFlags();
if (flags & forbidden_flags)
{
QTC::TC("qpdf", "QPDFAnnotationObjectHelper forbidden flags");