From 67dffd871f43422d0c3d9208bcbb0d429f4447b1 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 3 May 2024 18:31:00 +0200 Subject: [PATCH] QPdf: do not write a /Filter key if we are not compressing Streams may or may not be compressed depending on zlib availability, so fix this dictionary. This work has been kindly sponsored by the QGIS project (https://qgis.org/). Change-Id: I852569f053a1338d4bc54be5e8fb1e9c7741a5a1 Reviewed-by: Tobias Koenig Reviewed-by: Albert Astals Cid --- src/gui/painting/qpdf.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index 96ed769ce3..aaaf70087c 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -1802,7 +1802,8 @@ int QPdfEnginePrivate::writeOutputIntent() s << "/N 3\n"; s << "/Alternate /DeviceRGB\n"; s << "/Length " << length_object << "0 R\n"; - s << "/Filter /FlateDecode\n"; + if (do_compress) + s << "/Filter /FlateDecode\n"; s << ">>\n"; s << "stream\n"; write(data);