1

How can you increase the JPEG compression level on a PDF using batch tools under Linux?

Obviously you can use gs -dPDFSETTINGS=/screen or /ebook, but that downsamples the PDF - it reduces the DPI. It's more efficient (in terms of how nice the PDF looks per KB) to use JPEG compression while retaining the same pixel count.

E.g.: https://docupub.com/pdfcompress/ allows you to half the size of a PDF yet when you zoom in it still has good quality, albeit with some artifacts. When you zoom in using gs's /ebook mode, it inevitably looks more pixelated.

What Linux tool allows us to apply JPEG compression to each image in a PDF?

Is there any way to use ImageMagick's convert -quality on a PDF of multiple images?

0

ImageMagick's built-in convert can operate on PDFs:

convert -density 300 input.pdf -quality 30 output.pdf

Unfortunately quality does not seem to be recognized when adding other arguments such as threshold and fails to compress PDFs created by ImageMagick, e.g.:

convert -density 300 input.pdf -threshold 60% - | convert - -quality 30 output.pdf

fails - it produces three copies of each old page on each new page.

If you know how to work around this, please let me know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.