From bc1c4bb57864c4dbe9b7e42a77e0653c0d473071 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Thu, 21 Jun 2012 07:59:56 -0400 Subject: Add QPDF::processFile that takes an open FILE* --- include/qpdf/QPDF.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index ee9dba87..26f9cdc9 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -52,6 +52,14 @@ class QPDF QPDF_DLL void processFile(char const* filename, char const* password = 0); + // Parse a PDF from a stdio FILE*. The FILE must be open in + // binary mode and must be seekable. It may be open read only. + // This works exactly like processFile except that the PDF file is + // read from an already opened FILE*. The caller is responsible + // for closing the file. + QPDF_DLL + void processFile(FILE* file, char const* password = 0); + // Parse a PDF file loaded into a memory buffer. This works // exactly like processFile except that the PDF file is in memory // instead of on disk. The description appears in any warning or @@ -400,6 +408,7 @@ class QPDF public: FileInputSource(); void setFilename(char const* filename); + void setFile(FILE* filep); virtual ~FileInputSource(); virtual std::string const& getName() const; virtual off_t tell(); @@ -414,6 +423,7 @@ class QPDF void destroy(); + bool close_file; std::string filename; FILE* file; }; -- cgit v1.2.3-54-g00ecf