diff options
author | Jay Berkenbilt <ejb@ql.org> | 2019-01-04 18:32:02 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2019-01-04 18:37:22 +0100 |
commit | 16fd6e64f947e17144e05325e51d792df33eaa61 (patch) | |
tree | ca397d4fcdbc15fc6b9414c6a8db0c0343aba3e2 /include | |
parent | 837dcf8fc2546a80f205a0c4c53e5a1545c53a84 (diff) | |
download | qpdf-16fd6e64f947e17144e05325e51d792df33eaa61.tar.zst |
Add QPDFWriter::getFinalVersion (fixes #266)
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDFWriter.hh | 14 |
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; |