1

I convert a PDF with Ghostscript (9.20) to a PostScript File:

pdf2ps original.pdf optimized.ps

and then try to reconvert the PostScript to a smaller PDF file with the -dPDFSETTINGS=/screen or /ebook option to hopefully obtain a smaller PDF file size in the end:

ps2pdf -dPDFSETTINGS=/screen optimized.ps optimized.pdf

But then I get the following error during conversion:

Subsample filter does not support non-integer downsample factor (2.400000)
Failed to initialise downsample filter, downsampling aborted

What's missing or what I'm doing wrong? Couldn't find any solutions yet… :-(

Lukas Hillebrand
  • 390
  • 5
  • 20

1 Answers1

0

Firstly you don't need to do a multiple step conversion PDF->PS->PDF, a simple PDF->PDF will work.

The warning is due to trying to downsample images to a lower resolution, and the scale factor is not an integer. So in this case, it won't downsample. If you insist on using the canned settings instead of setting the controls yourself, then I'm afraid you are pretty much always going to be in the dark. It would be much better to read the documentation and work out which controls to set, based on the type of input you have, and the compromises you are prepared to accept on quality.

In this case, you will almost certainly have to not downsample monochrome images. See the documentation on how to achieve that.

You have not stated the version of Ghostscript you are using which makes it even harder to comment here, however there is an open enhancement request regarding the downsampling filter here

Which originated with a Stack Overflow question here

Community
  • 1
  • 1
KenS
  • 30,202
  • 3
  • 34
  • 51
  • Thanks @KenS for your answer. My Ghostscript Version is 9.20. I have done also a PDF->PDF conversion before with the same error message. Since I'm pretty new to Ghostscript and the documentation is pretty long I've hoped for a hint. – Lukas Hillebrand Nov 23 '16 at 17:59
  • If you look at the SO question, there's a command line in my answer which gives a fairly good idea of how to go about it. Also, that's not an error message **unless*, like the pointer in the bug report, your original includes 1 bit images, in which case you need to turn off downsampling monochrome images, as I said above (and see the other question). – KenS Nov 23 '16 at 20:29
  • OK thanks @KenS for your help, appreciate it :-) will try to fix it durcing the weekend. – Lukas Hillebrand Nov 24 '16 at 07:16