aboutsummaryrefslogtreecommitdiffstats
path: root/include/qpdf/QPDFWriter.hh
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2012-07-06 03:22:27 +0200
committerJay Berkenbilt <ejb@ql.org>2012-07-06 03:24:04 +0200
commit8705e2e8fc1a9721b2438c09ba7e92ec673af19d (patch)
treebba745e53ae9aa63a883bc8b3d4fbef797f0cb9f /include/qpdf/QPDFWriter.hh
parent3b5d72b9462988bbbf9422aa82954414368533d9 (diff)
downloadqpdf-8705e2e8fc1a9721b2438c09ba7e92ec673af19d.tar.zst
Add QPDFWriter method to output to FILE*
Diffstat (limited to 'include/qpdf/QPDFWriter.hh')
-rw-r--r--include/qpdf/QPDFWriter.hh16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh
index 25acbb14..2261e45b 100644
--- a/include/qpdf/QPDFWriter.hh
+++ b/include/qpdf/QPDFWriter.hh
@@ -49,6 +49,14 @@ class QPDFWriter
// setOutputFilename() for details.
QPDF_DLL
QPDFWriter(QPDF& pdf, char const* filename);
+
+ // Create a QPDFWriter object that writes its output to an already
+ // open FILE*. This is equivalent to calling the first
+ // constructor and then calling setOutputFile(). See
+ // setOutputFile() for details.
+ QPDF_DLL
+ QPDFWriter(QPDF& pdf, char const* description, FILE* file, bool close_file);
+
QPDF_DLL
~QPDFWriter();
@@ -66,6 +74,14 @@ class QPDFWriter
QPDF_DLL
void setOutputFilename(char const* filename);
+ // Write to the given FILE*, which must be opened by the caller.
+ // If close_file is true, QPDFWriter will close the file.
+ // Otherwise, the caller must close the file. The file does not
+ // need to be seekable; it will be written to in a single pass.
+ // It must be open in binary mode.
+ QPDF_DLL
+ void setOutputFile(char const* description, FILE* file, bool close_file);
+
// Indicate that QPDFWriter should create a memory buffer to
// contain the final PDF file. Obtain the memory by calling
// getBuffer().