miyako / 4d-plugin-gs

4D implementation of Ghostscript
MIT License
1 stars 0 forks source link

The result of the compression gives an empty pdf on some file #2

Closed michelottiABV closed 3 years ago

michelottiABV commented 3 years ago

I am having a compression problem on some pdf files. On mac OS, I use the GS plugin to perform the compression and the result regularly gives empty pdfs files but no conversion error. I am attaching a pdf file which is problematic.

Can you help me, this is a major problem for our app. Is this a problem with the plugin or just with ghostscript?

File.pdf

$vtPathIn:="" //Path of original pdf file $vtPathOut:="" //Path to the compress file

ARRAY TEXT ($ttArguments;0) APPEND TO ARRAY ($ttArguments;"-dNOPAUSE") APPEND TO ARRAY ($ttArguments;"-dBATCH") APPEND TO ARRAY ($ttArguments;"-dQUIET") APPEND TO ARRAY ($ttArguments;"-dSAFER") APPEND TO ARRAY ($ttArguments;"-sDEVICE=pdfwrite") APPEND TO ARRAY ($ttArguments;"-dCompatibilityLevel=1.7") APPEND TO ARRAY ($ttArguments;"-dAutoRotatePages=/None") APPEND TO ARRAY ($ttArguments;"-dPDFSETTINGS=/default") APPEND TO ARRAY ($ttArguments;"-sOutputFile="+Convert path system to POSIX ($vtPathOut)) APPEND TO ARRAY ($ttArguments;"-f") APPEND TO ARRAY ($ttArguments;Convert path system to POSIX ($vtPathIn)) APPEND TO ARRAY ($ttArguments;"-q")

$vlError:=GS ($ttArguments)

miyako commented 3 years ago

I don't know, to be honest. does gs need zlib for compression? maybe the dll is wrongly compiled without compression support.

michelottiABV commented 3 years ago

Thanks for the answer, I will continue to search with these tips.

miyako commented 3 years ago

as you see here

https://github.com/miyako/4d-plugin-gs

zlib is enabled but not zstd or lzma2 or libdeflate

miyako commented 3 years ago

your PDF is generated by GrapeCity Pdf Library JS. maybe that is the issue.

miyako commented 3 years ago

could CompatibilityLevel=1.7 be an issue? your PDF is 1.3

michelottiABV commented 3 years ago

Thank you very much for your feedback. After research, the problem comes from GrapeCity PDF Library. A header that was not correctly defined. Sorry for the inconvenience and thank you again for this plugin which is very helpful to us.