PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

ignoring zlib error: incorrect data check
http://forum.pdfsharp.com/viewtopic.php?f=3&t=4529
Page 1 of 1

Author:  dssmith [ Thu Jan 04, 2024 2:39 pm ]
Post subject:  ignoring zlib error: incorrect data check

We are using PDFSharp 6.1.0-preview-1 on Docker with alphine linux, we create a pdf by combining a few existing pdf files , then use ghostscript to further compress the pdf files, when we upgraded we seem to be getting an error even though the pdf is compressed and created... Attached is a Sample PDF created on windows using PDFSharp, and another though word and saved as PDF, and the command we are using in docker (linux) to compress this file is:

gs -o "compressed.pdf" -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dEmbedAllFonts=false -dSubsetFonts=true -f "Sample.pdf"

The error we get when trying to compress the PDFSharp PDF is:

/tmp $ gs -o "compressed.pdf" -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dEmbedAllFonts=false -dSubsetFonts=true -f "Sample.pdf"
GPL Ghostscript 10.02.0 (2023-09-13)
Copyright (C) 2023 Artifex Software, Inc. All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Processing pages 1 through 8.
Page 1
warning: ignoring zlib error: incorrect data check
Page 2
warning: ignoring zlib error: incorrect data check
Page 3
warning: ignoring zlib error: incorrect data check
Page 4
warning: ignoring zlib error: incorrect data check
Page 5
warning: ignoring zlib error: incorrect data check
Page 6
warning: ignoring zlib error: incorrect data check
Page 7
warning: ignoring zlib error: incorrect data check
Page 8
warning: ignoring zlib error: incorrect data check

When we run the other pdf file through this conversion it works:

/tmp $ gs -o "compressed.pdf" -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -f "Sample_Other.pdf"
GPL Ghostscript 10.02.0 (2023-09-13)
Copyright (C) 2023 Artifex Software, Inc. All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Processing pages 1 through 4.
Page 1
Page 2
Page 3
Page 4

Just wanted to find out if this could be anything within the created pdf structure that is causing this?

Attachments:
Sample_PDF.zip [148.38 KiB]
Downloaded 875 times

Author:  Thomas Hoevel [ Tue Jan 09, 2024 8:46 am ]
Post subject:  Re: ignoring zlib error: incorrect data check

So GS emits a warning and I don't know if there really is an issue behind that warning.
Difficult to start searching anyway.

One question: If you open that sample.pdf with Adobe Reader, and then use "File" => "Save as" to save it under a different name, and then process that file with GS, will you still get the same warnings?

If yes, then Adobe Reader sees no issue and then the GS warnings can probably be ignored.
If no, then maybe we should look after it.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/