diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDF.hh | 14 | ||||
-rw-r--r-- | include/qpdf/QPDFObjectHandle.hh | 3 | ||||
-rw-r--r-- | include/qpdf/QPDFWriter.hh | 12 |
3 files changed, 22 insertions, 7 deletions
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index 18a6851f..ef9ce597 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -540,13 +540,14 @@ class QPDF { friend class QPDF_Stream; private: - static void pipeStreamData(QPDF* qpdf, int objid, int generation, + static bool pipeStreamData(QPDF* qpdf, int objid, int generation, qpdf_offset_t offset, size_t length, QPDFObjectHandle dict, - Pipeline* pipeline) + Pipeline* pipeline, bool suppress_warnings) { - qpdf->pipeStreamData( - objid, generation, offset, length, dict, pipeline); + return qpdf->pipeStreamData( + objid, generation, offset, length, dict, pipeline, + suppress_warnings); } }; friend class Pipe; @@ -666,10 +667,11 @@ class QPDF void findAttachmentStreams(); // Calls finish() on the pipeline when done but does not delete it - void pipeStreamData(int objid, int generation, + bool pipeStreamData(int objid, int generation, qpdf_offset_t offset, size_t length, QPDFObjectHandle dict, - Pipeline* pipeline); + Pipeline* pipeline, + bool suppress_warnings); // For QPDFWriter: diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index 0fc989a5..11a52596 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -394,7 +394,8 @@ class QPDFObjectHandle // replaced if writing a new stream object. QPDF_DLL bool pipeStreamData(Pipeline*, bool filter, - bool normalize, bool compress); + bool normalize, bool compress, + bool suppress_warnings = false); // Replace a stream's dictionary. The new dictionary must be // consistent with the stream's data. This is most appropriately diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh index b2738c1f..2687cce0 100644 --- a/include/qpdf/QPDFWriter.hh +++ b/include/qpdf/QPDFWriter.hh @@ -144,6 +144,17 @@ class QPDFWriter QPDF_DLL void setQDFMode(bool); + // Enable stream precheck mode. In this mode, all filterable + // streams are checked by actually attempting to decode them + // before filtering. This may add significant time to the process + // of writing the data because all streams from the input must be + // read twice, but it enables the raw stream data to be preserved + // even in cases where qpdf would run into errors decoding the + // stream after it determines that it should be able to do it. + // Examples would include compressed data with errors in it. + QPDF_DLL + void setPrecheckStreams(bool); + // Set the minimum PDF version. If the PDF version of the input // file (or previously set minimum version) is less than the // version passed to this method, the PDF version of the output @@ -415,6 +426,7 @@ class QPDFWriter bool stream_data_mode_set; qpdf_stream_data_e stream_data_mode; bool qdf_mode; + bool precheck_streams; bool static_id; bool suppress_original_object_ids; bool direct_stream_lengths; |