Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#145 tool.pdf.Compress increases PDF image size by 8%

Péter Szabó

The latest tool.pdf.Compress increases the file size of the PDF http://www.math.bme.hu/~pts/300dpi_all.type1c.pdf by 8%. The most probable reason is that the input PDF contains lots of images, most of them being very tightly compressed with PNGOUT. When tool.pdf.Compress processes the PDF file, it recompresses the images with an inferior algorithm, not paying attention to the fact that the original image was smaller than the recompressed image.

Suggested fix 1: keep the original image if it is smaller than the recompressed image.

Optional fix 2, in addition to suggested fix 2: add a command-line flag which prevents image recompression. If the user is sure that all images in the PDF are small enough, he would invoke tool.pdf.Compress with this flag, and save CPU time.


  • Hi, have taken a look on your topic...

    can reproduce your problem, size increases...additionally the pictures are distorted for me (maybe related to java 1.6 ...search the bug report here, there are suggestions for -Djava.compiler=NONE).

    some questions to your setup:
    first, why your pdf has the (complete outdated) version 1.0? tex should be able to produce at least 1.2 or 1.4... maybe here is one root of the problems.

    second, the compress tool only changes pictures if told so.... with the additonal -jpeg switch, was this activated?
    see: http://multivalent.sourceforge.net/Tools/pdf/Compress.html