diff options
Diffstat (limited to 'include/qpdf/QPDFWriter.hh')
-rw-r--r-- | include/qpdf/QPDFWriter.hh | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh index 15e9317b..651c8f61 100644 --- a/include/qpdf/QPDFWriter.hh +++ b/include/qpdf/QPDFWriter.hh @@ -32,7 +32,7 @@ class QPDF; class QPDFObjectHandle; class Pl_Count; -class DLL_EXPORT QPDFWriter +class QPDFWriter { public: // Passing null as filename means write to stdout. QPDFWriter @@ -42,7 +42,9 @@ class DLL_EXPORT QPDFWriter // useful for tracking down problems. If your application doesn't // want the partially written file to be left behind, you should // delete it the eventual call to write fails. + DLL_EXPORT QPDFWriter(QPDF& pdf, char const* filename); + DLL_EXPORT ~QPDFWriter(); // Set the value of object stream mode. In disable mode, we never @@ -52,6 +54,7 @@ class DLL_EXPORT QPDFWriter // generate a conventional cross-reference table if there are no // object streams and a cross-reference stream if there are object // streams. The default is o_preserve. + DLL_EXPORT void setObjectStreamMode(qpdf_object_stream_e); // Set value of stream data mode. In uncompress mode, we attempt @@ -59,6 +62,7 @@ class DLL_EXPORT QPDFWriter // preserve any filtering applied to streams. In compress mode, // if we can apply all filters and the stream is not already // optimally compressed, recompress the stream. + DLL_EXPORT void setStreamDataMode(qpdf_stream_data_e); // Set value of content stream normalization. The default is @@ -68,6 +72,7 @@ class DLL_EXPORT QPDFWriter // damage the content stream. This flag should be used only for // debugging and experimenting with PDF content streams. Never // use it for production files. + DLL_EXPORT void setContentNormalization(bool); // Set QDF mode. QDF mode causes special "pretty printing" of @@ -75,6 +80,7 @@ class DLL_EXPORT QPDFWriter // Resulting PDF files can be edited in a text editor and then run // through fix-qdf to update cross reference tables and stream // lengths. + DLL_EXPORT void setQDFMode(bool); // Set the minimum PDF version. If the PDF version of the input @@ -86,6 +92,7 @@ class DLL_EXPORT QPDFWriter // QPDFWriter automatically sets the minimum version to 1.4 when // R3 encryption parameters are used, and to 1.5 when object // streams are used. + DLL_EXPORT void setMinimumPDFVersion(std::string const&); // Force the PDF version of the output file to be a given version. @@ -103,27 +110,32 @@ class DLL_EXPORT QPDFWriter // that type of encryption will explicitly disable decryption. // Additionally, forcing to a version below 1.5 will disable // object streams. + DLL_EXPORT void forcePDFVersion(std::string const&); // Cause a static /ID value to be generated. Use only in test // suites. + DLL_EXPORT void setStaticID(bool); // Use a fixed initialization vector for AES-CBC encryption. This // is not secure. It should be used only in test suites for // creating predictable encrypted output. + DLL_EXPORT void setStaticAesIV(bool); // Suppress inclusion of comments indicating original object IDs // when writing QDF files. This can also be useful for testing, // particularly when using comparison of two qdf files to // determine whether two PDF files have identical content. + DLL_EXPORT void setSuppressOriginalObjectIDs(bool); // Preserve encryption. The default is true unless prefilering, // content normalization, or qdf mode has been selected in which // case encryption is never preserved. Encryption is also not // preserved if we explicitly set encryption parameters. + DLL_EXPORT void setPreserveEncryption(bool); // Set up for encrypted output. Disables stream prefiltering and @@ -132,14 +144,17 @@ class DLL_EXPORT QPDFWriter // encryption parameters pushes the PDF version number to at least // 1.4, and setting R4 parameters pushes the version to at least // 1.5, or if AES is used, 1.6. + DLL_EXPORT void setR2EncryptionParameters( char const* user_password, char const* owner_password, bool allow_print, bool allow_modify, bool allow_extract, bool allow_annotate); + DLL_EXPORT void setR3EncryptionParameters( char const* user_password, char const* owner_password, bool allow_accessibility, bool allow_extract, qpdf_r3_print_e print, qpdf_r3_modify_e modify); + DLL_EXPORT void setR4EncryptionParameters( char const* user_password, char const* owner_password, bool allow_accessibility, bool allow_extract, @@ -148,11 +163,16 @@ class DLL_EXPORT QPDFWriter // Create linearized output. Disables qdf mode, content // normalization, and stream prefiltering. + DLL_EXPORT void setLinearization(bool); + DLL_EXPORT void write(); private: + QPDFWriter(QPDFWriter const&); + QPDFWriter& operator=(QPDFWriter const&); + // flags used by unparseObject static int const f_stream = 1 << 0; static int const f_filtered = 1 << 1; |