You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Kernel: On net10.0, an empty content stream is written as FlateDecode with /Length 0 #640
Input: a page with no content, saved with default settings.
Measured on a probe built from the test(kernel): pin the catalog bytes of Save and the signing path (part of #606) #626 branch (test/catalog-golden-hashes, branched from main bd85e70), Release, same document on two runtimes: on net10.0 (runtime 10.0.15) the page's content stream is /Filter /FlateDecode, /Length 0, and the stream body is empty. On net11.0 (runtime 11.0.0) the same stream is /Length 8 with the bytes 78 9C 03 00 00 00 00 01. An empty body is not a zlib stream (RFC 1950 needs a header and an Adler-32), so a strict reader of the net10.0 file has nothing to inflate. Every variant I dumped (plain, outline, tagged, PDF/A-2u, PDF/UA-1, form, linearized, object streams) has exactly one such stream, /Length 0 on net10.0 and /Length 8 on net11.0.
Cause by reading: PdfStream.cs:74-75 compresses through ZLibStream and does not special-case zero input. That net10.0's ZLibStream writes nothing when given no data is what the output above shows; the runtime source was not read.
qpdf --check (12.4.2) on the net10.0 file reports "No syntax or stream encoding errors found" and exits 0, so qpdf does not flag the empty FlateDecode body.
API: PdfDocument.Save, PdfStream (a content stream with no operators).
Suggested milestone: v2.4 (writes a stream that is not valid zlib on the LTS target). Fix shape: when the uncompressed body is empty, write the 8-byte empty zlib stream explicitly, or write no /Filter.
Activity
docs(kernel): narrow the #640 claims to what was measured