diff options
Diffstat (limited to 'qpdf/test_driver.cc')
-rw-r--r-- | qpdf/test_driver.cc | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/qpdf/test_driver.cc b/qpdf/test_driver.cc index ff55e63f..aef46d87 100644 --- a/qpdf/test_driver.cc +++ b/qpdf/test_driver.cc @@ -1463,7 +1463,7 @@ void runtest(int n, char const* filename1, char const* arg2) { QPDFPageObjectHelper& page(*iter); ParserCallbacks cb; - page.parsePageContents(&cb); + page.parseContents(&cb); } } else if (n == 38) @@ -2279,6 +2279,27 @@ void runtest(int n, char const* filename1, char const* arg2) std::cout << i.first << " -> " << i.second.unparse() << std::endl; } } + else if (n == 72) + { + // Call some QPDFPageObjectHelper methods on form XObjects. + auto page = QPDFPageDocumentHelper(pdf).getAllPages().at(0); + auto fx1 = QPDFPageObjectHelper( + page.getObjectHandle() + .getKey("/Resources") + .getKey("/XObject") + .getKey("/Fx1")); + std::cout << "--- parseContents ---" << std::endl; + ParserCallbacks cb; + fx1.parseContents(&cb); + Pl_Buffer b("buffer"); + fx1.addContentTokenFilter(new TokenFilter); + fx1.pipeContents(&b); + std::unique_ptr<Buffer> buf(b.getBuffer()); + std::string s( + reinterpret_cast<char const*>(buf->getBuffer()), + buf->getSize()); + assert(s.find("/bye") != std::string::npos); + } else { throw std::runtime_error(std::string("invalid test ") + |