aboutsummaryrefslogtreecommitdiffstats
path: root/include/qpdf/QPDFWriter.hh
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-01-04 18:32:02 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-04 18:37:22 +0100
commit16fd6e64f947e17144e05325e51d792df33eaa61 (patch)
treeca397d4fcdbc15fc6b9414c6a8db0c0343aba3e2 /include/qpdf/QPDFWriter.hh
parent837dcf8fc2546a80f205a0c4c53e5a1545c53a84 (diff)
downloadqpdf-16fd6e64f947e17144e05325e51d792df33eaa61.tar.zst
Add QPDFWriter::getFinalVersion (fixes #266)
Diffstat (limited to 'include/qpdf/QPDFWriter.hh')
-rw-r--r--include/qpdf/QPDFWriter.hh14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh
index 4385a409..8f18dad1 100644
--- a/include/qpdf/QPDFWriter.hh
+++ b/include/qpdf/QPDFWriter.hh
@@ -404,6 +404,18 @@ class QPDFWriter
QPDF_DLL
void registerProgressReporter(PointerHolder<ProgressReporter>);
+ // Return the PDF version that will be written into the header.
+ // Calling this method does all the preparation for writing, so it
+ // is an error to call any methods that may cause a change to the
+ // version. Adding new objects to the original file after calling
+ // this may also cause problems. It is safe to update existing
+ // objects or stream contents after calling this method, e.g., to
+ // include the final version number in metadata.
+ QPDF_DLL
+ std::string getFinalVersion();
+
+ // Write the final file. There is no expectation of being able to
+ // call write() more than once.
QPDF_DLL
void write();
@@ -473,6 +485,7 @@ class QPDFWriter
void writeLinearized();
void enqueuePart(std::vector<QPDFObjectHandle>& part);
void writeEncryptionDictionary();
+ void doWriteSetup();
void writeHeader();
void writeHintStream(int hint_id);
qpdf_offset_t writeXRefTable(
@@ -598,6 +611,7 @@ class QPDFWriter
bool deterministic_id;
Pl_MD5* md5_pipeline;
std::string deterministic_id_data;
+ bool did_write_setup;
// For linearization only
std::string lin_pass1_filename;