文档内容流存在损坏的压缩流导致文档结构查看器返回的内容流不全
Author: CharltsingCreated Feb 14, 2026Updated Feb 16, 2026
Labels改进
问题出在 \iTextSharp\core\iTextSharp\text\pdf\PdfReader.cs 的Flate解压缩函数 internal static byte[] FlateDecode(byte[] inp, MemoryStream outS)
//不能直接使用outS,会被close,导致下一句无法执行。
byte[] b = FlateDecode(inp, true, new MemoryStream(outS.ToArray()));itext-dotnet 在 FlateDecodeFilter.cs#L44 里已经改成不释放了。也不一定好。
Source: wmjordan/PDFPatcher