From 3be58f49e57da67cf79b61061d8b1a0f7ccf7cff Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 2 Jan 2021 14:05:17 -0500 Subject: Make more QPDFPageObjectHelper methods work with form XObject --- include/qpdf/QPDFObjectHandle.hh | 6 +++++- include/qpdf/QPDFPageObjectHelper.hh | 13 ++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index 2a5d0392..e310f091 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -448,7 +448,7 @@ class QPDFObjectHandle void parsePageContents(ParserCallbacks* callbacks); QPDF_DLL void filterPageContents(TokenFilter* filter, Pipeline* next = 0); - // See comments for QPDFPageObjectHelper::pipePageContents. + // See comments for QPDFPageObjectHelper::pipeContents. QPDF_DLL void pipePageContents(Pipeline* p); QPDF_DLL @@ -460,6 +460,10 @@ class QPDFObjectHandle // XObject, whose data is in the same format as a content stream. QPDF_DLL void filterAsContents(TokenFilter* filter, Pipeline* next = 0); + // Called on a stream to parse the stream as page contents. This + // can be used to parse a form XObject. + QPDF_DLL + void parseAsContents(ParserCallbacks* callbacks); // Type-specific factories QPDF_DLL diff --git a/include/qpdf/QPDFPageObjectHelper.hh b/include/qpdf/QPDFPageObjectHelper.hh index ccf56630..ee813c96 100644 --- a/include/qpdf/QPDFPageObjectHelper.hh +++ b/include/qpdf/QPDFPageObjectHelper.hh @@ -182,7 +182,11 @@ class QPDFPageObjectHelper: public QPDFObjectHelper // Parse a page's contents through ParserCallbacks, described // above. This method works whether the contents are a single - // stream or an array of streams. Call on a page object. + // stream or an array of streams. Call on a page object. Also + // works for form XObjects. + QPDF_DLL + void parseContents(QPDFObjectHandle::ParserCallbacks* callbacks); + // Old name QPDF_DLL void parsePageContents(QPDFObjectHandle::ParserCallbacks* callbacks); @@ -206,14 +210,17 @@ class QPDFPageObjectHelper: public QPDFObjectHelper // Pipe a page's contents through the given pipeline. This method // works whether the contents are a single stream or an array of - // streams. + // streams. Also works on form XObjects. + QPDF_DLL + void pipeContents(Pipeline* p); + // Old name QPDF_DLL void pipePageContents(Pipeline* p); // Attach a token filter to a page's contents. If the page's // contents is an array of streams, it is automatically coalesced. // The token filter is applied to the page's contents as a single - // stream. + // stream. Also works on form XObjects. QPDF_DLL void addContentTokenFilter( PointerHolder token_filter); -- cgit v1.2.3-70-g09d2