aboutsummaryrefslogtreecommitdiffstats
path: root/include/qpdf/QPDFWriter.hh
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2017-07-28 05:42:27 +0200
committerJay Berkenbilt <ejb@ql.org>2017-07-28 05:42:27 +0200
commit7f8892525f897b17049f9e59bc4ce8ac28c9e082 (patch)
tree8f46d2ac355e8245cb2e0c764ebe0b34923e3494 /include/qpdf/QPDFWriter.hh
parent428d96dfe19da96ac4759b190f5b25cf75ecdac6 (diff)
downloadqpdf-7f8892525f897b17049f9e59bc4ce8ac28c9e082.tar.zst
Add precheck streams capability
When requested, QPDFWriter will do more aggress prechecking of streams to make sure it can actually succeed in decoding them before attempting to do so. This will allow preservation of raw data even when the raw data is corrupted relative to the specified filters.
Diffstat (limited to 'include/qpdf/QPDFWriter.hh')
-rw-r--r--include/qpdf/QPDFWriter.hh12
1 files changed, 12 insertions, 0 deletions
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;