View Single Post
Old 06-14-2019, 09:25 PM   #1
MarjaE
Guru
MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.
 
Posts: 937
Karma: 53902736
Join Date: Jun 2015
Device: multiple
Pdf compression options in Ghostscript?

Hi,

I am looking for options to speed up my pdfs so they load faster on the Kindle Dx and never crash it. I already convert to version 1.4, either using Ghostscript or Willus' k2pdfopt.

I am trying to optimize for compatibility, and then speed, not file size, so jpeg-2000 is not an option.

1. Conversion with Compression, older system

I used to use the following to pre-process some pdfs for older Kindle compatibility. I mostly ran it in Apple's Automator for drag-and-drop w/o extra typing, but that requires different syntax. It had the side effect of compressing images, and sometimes obscuring pages which had been wrong rendered as images:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

I think I can get milder compression with:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

based on these instructions, but reversing the polarity: http://www.spoonylife.org/level-3/co...to-1-5-1-6-etc

2. Conversion without Compression

I currently use the following. I mostly run it in Apple's Automator for the same reason, but that requires different syntax. It avoids obscuring pages, but it sometimes leaves a lot of large images which slow down, freeze, or even crash my Kindle Dx:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

3. Text-Only, unreliable

I also experimented with variations on the following, but it would lose scale on pages and lose real text as well as images:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dFILTERIMAGE -dFILTERVECTOR -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

4. Conversion with compression, is there a new system?

Current Ghostscript documentation such as "How to use Ghostscript" avoids mentioning -dPDFSETTINGS or listing the options:

https://www.ghostscript.com/doc/current/Use.htm

But they do mention the extremely buggy and even more aggressive -dFILTERIMAGE and -dFILTERVECTOR, so is there some problem with -dPDFSETTINGS where they want to discourage use short of dropping the function...?

And is there another option replacing -dPDFSETTINGS?
MarjaE is offline   Reply With Quote