aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFPageDocumentHelper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDFPageDocumentHelper.cc')
-rw-r--r--libqpdf/QPDFPageDocumentHelper.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/libqpdf/QPDFPageDocumentHelper.cc b/libqpdf/QPDFPageDocumentHelper.cc
index 1dacd672..fa50c471 100644
--- a/libqpdf/QPDFPageDocumentHelper.cc
+++ b/libqpdf/QPDFPageDocumentHelper.cc
@@ -141,11 +141,7 @@ QPDFPageDocumentHelper::flattenAnnotationsForPage(
QTC::TC("qpdf", "QPDFPageDocumentHelper skip widget need appearances");
process = false;
}
- if (process && (! as.isStream()))
- {
- process = false;
- }
- if (process)
+ if (process && as.isStream())
{
if (is_widget)
{
@@ -200,6 +196,15 @@ QPDFPageDocumentHelper::flattenAnnotationsForPage(
}
new_content += content;
}
+ else if (process)
+ {
+ // If an annotation has no appearance stream, just drop
+ // the annotation when flattening. This can happen for
+ // unchecked checkboxes and radio buttons, popup windows
+ // associated with comments that aren't visible, and other
+ // types of annotations that aren't visible.
+ QTC::TC("qpdf", "QPDFPageDocumentHelper ignore annotation with no appearance");
+ }
else
{
new_annots.push_back(aoh.getObjectHandle());