aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFPageObjectHelper.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2021-01-02 20:05:17 +0100
committerJay Berkenbilt <ejb@ql.org>2021-01-02 20:08:53 +0100
commit3be58f49e57da67cf79b61061d8b1a0f7ccf7cff (patch)
tree2d651afb06b9037d5dc8aab2745ea9e65652885f /libqpdf/QPDFPageObjectHelper.cc
parent98da4fd83527f47a28132ff4a120bc043d9e58f6 (diff)
downloadqpdf-3be58f49e57da67cf79b61061d8b1a0f7ccf7cff.tar.zst
Make more QPDFPageObjectHelper methods work with form XObject
Diffstat (limited to 'libqpdf/QPDFPageObjectHelper.cc')
-rw-r--r--libqpdf/QPDFPageObjectHelper.cc40
1 files changed, 37 insertions, 3 deletions
diff --git a/libqpdf/QPDFPageObjectHelper.cc b/libqpdf/QPDFPageObjectHelper.cc
index f7fcd395..3e303f6a 100644
--- a/libqpdf/QPDFPageObjectHelper.cc
+++ b/libqpdf/QPDFPageObjectHelper.cc
@@ -584,7 +584,21 @@ void
QPDFPageObjectHelper::parsePageContents(
QPDFObjectHandle::ParserCallbacks* callbacks)
{
- this->oh.parsePageContents(callbacks);
+ parseContents(callbacks);
+}
+
+void
+QPDFPageObjectHelper::parseContents(
+ QPDFObjectHandle::ParserCallbacks* callbacks)
+{
+ if (this->oh.isFormXObject())
+ {
+ this->oh.parseAsContents(callbacks);
+ }
+ else
+ {
+ this->oh.parsePageContents(callbacks);
+ }
}
void
@@ -613,14 +627,34 @@ QPDFPageObjectHelper::filterContents(
void
QPDFPageObjectHelper::pipePageContents(Pipeline* p)
{
- this->oh.pipePageContents(p);
+ pipeContents(p);
+}
+
+void
+QPDFPageObjectHelper::pipeContents(Pipeline* p)
+{
+ if (this->oh.isFormXObject())
+ {
+ this->oh.pipeStreamData(p, 0, qpdf_dl_specialized);
+ }
+ else
+ {
+ this->oh.pipePageContents(p);
+ }
}
void
QPDFPageObjectHelper::addContentTokenFilter(
PointerHolder<QPDFObjectHandle::TokenFilter> token_filter)
{
- this->oh.addContentTokenFilter(token_filter);
+ if (this->oh.isFormXObject())
+ {
+ this->oh.addTokenFilter(token_filter);
+ }
+ else
+ {
+ this->oh.addContentTokenFilter(token_filter);
+ }
}
class NameWatcher: public QPDFObjectHandle::TokenFilter