diff options
author | Jay Berkenbilt <ejb@ql.org> | 2019-08-24 01:59:38 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2019-08-24 02:34:21 +0200 |
commit | 2794bfb1a665cad93a38144bea0ba0daea7152e7 (patch) | |
tree | e83256473254f4935de0477d784a2123a7828d27 /include | |
parent | dac0598b94c877bec92a1edd78ae00021cfa1638 (diff) | |
download | qpdf-2794bfb1a665cad93a38144bea0ba0daea7152e7.tar.zst |
Add flags to control zlib compression level (fixes #113)
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDFWriter.hh | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh index 860b0630..0fd114db 100644 --- a/include/qpdf/QPDFWriter.hh +++ b/include/qpdf/QPDFWriter.hh @@ -189,10 +189,11 @@ class QPDFWriter // filters on the input. When combined with // setCompressStreams(true), which the default, the effect of this // is that streams filtered with these older and less efficient - // filters will be recompressed with the Flate filter. As a - // special case, if a stream is already compressed with + // filters will be recompressed with the Flate filter. By default, + // as a special case, if a stream is already compressed with // FlateDecode and setCompressStreams is enabled, the original - // compressed data will be preserved. + // compressed data will be preserved. This behavior can be + // overridden by calling setRecompressFlate(true). // // qpdf_dl_specialized: In addition to uncompressing the // generalized compression formats, supported non-lossy @@ -209,6 +210,15 @@ class QPDFWriter QPDF_DLL void setDecodeLevel(qpdf_stream_decode_level_e); + // By default, when both the input and output contents of a stream + // are compressed with Flate, qpdf does not uncompress and + // recompress the stream. Passing true here causes it to do so. + // This can be useful if recompressing all streams with a higher + // compression level, which can be set by calling the static + // method Pl_Flate::setCompressionLevel. + QPDF_DLL + void setRecompressFlate(bool); + // Set value of content stream normalization. The default is // "false". If true, we attempt to normalize newlines inside of // content streams. Some constructs such as inline images may @@ -597,6 +607,7 @@ class QPDFWriter bool compress_streams_set; qpdf_stream_decode_level_e stream_decode_level; bool stream_decode_level_set; + bool recompress_flate; bool qdf_mode; bool preserve_unreferenced_objects; bool newline_before_endstream; |