Tuesday 19 September 2017

Ghostscript's /ebook preset creating some undesired effect on PDF but /printer doesn't

I would like to use ghostscript (version 9.27) to batch compress big quantities of pdf files. The best option for me regarding compress ratio is -dPDFSETTINGS=/ebook, since it is able to reduce my files on average to about 40-50% of original size.


gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed.pdf original.pdf

Problem is that black background appears behind some text in a compressed pdf and makes it unusable. Using -dPDFSETTINGS=/printer presets does not produce this black background effect but is not an option for me since it does not compress enough.


gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed.pdf original.pdf

I did a comparison between this settings thanks to this post and tried tweaking specific settings but with no luck. Thank you if anybody has an idea. I will try to generate a pdf without user sensitive information which I can append. For now, these are only snips of the part of the pdf document that gets "corrupted" during compression.


before compressing ----> after compressing

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...