From 041397fdabde66574824db7582a26ef1e3fbfc65 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 23 Sep 2012 17:42:26 -0400 Subject: Allow reading from InputSource and writing to Pipeline Allowing users to subclass InputSource and Pipeline to read and write from/to arbitrary sources provides the maximum flexibility for users who want to read and write from other than files or memory. --- include/qpdf/QPDF.hh | 7 +++++++ include/qpdf/QPDFWriter.hh | 9 +++++++++ 2 files changed, 16 insertions(+) (limited to 'include') diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index e594a44a..64858625 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -72,6 +72,13 @@ class QPDF char const* buf, size_t length, char const* password = 0); + // Parse a PDF file loaded from a custom InputSource. If you have + // your own method of retrieving a PDF file, you can subclass + // InputSource and use this method. + QPDF_DLL + void processInputSource(PointerHolder, + char const* password = 0); + // Create a QPDF object for an empty PDF. This PDF has no pages // or objects other than a minimal trailer, a document catalog, // and a /Pages tree containing zero pages. Pages and other diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh index 2c1c32f6..725b2be8 100644 --- a/include/qpdf/QPDFWriter.hh +++ b/include/qpdf/QPDFWriter.hh @@ -95,6 +95,15 @@ class QPDFWriter QPDF_DLL Buffer* getBuffer(); + // Supply your own pipeline object. Output will be written to + // this pipeline, and QPDFWriter will call finish() on the + // pipeline. It is the caller's responsibility to manage the + // memory for the pipeline. The pipeline is never deleted by + // QPDFWriter, which makes it possible for you to call additional + // methods on the pipeline after the writing is finished. + QPDF_DLL + void setOutputPipeline(Pipeline*); + // Setting Parameters // Set the value of object stream mode. In disable mode, we never -- cgit v1.2.3-54-g00ecf