21

I have a ~259 MB PDF. I did pdf2ps and ps2pdf. The final size was 45 MB. I don't see any visible difference in quality in any reader. Although, the bookmarks were lost. I tried using pdftk, but it didn't preserve the bookmarks.

pdftk ... update_info

What caused the huge reduction in size? Is there an alternative to preserve the bookmarks and still have the reduced size (preferably linux command-line alternatives)?

1
  • Following up on @Dan's answer: different encodings (and compression) could explain the difference. As a simple test, look at the size of either file after compression with gzip. Is the size difference still impressive? Aug 24, 2012 at 22:39

3 Answers 3

17

You can try ghostscript with ebook output and the bookmarks seems to be preserved:

gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dPDFSETTINGS=/ebook -sOutputFile=newFile.pdf originalFile.pdf
2
  • 2
    thanks it worked. I used the PDFSETTINGS=/screen. With that option the pdf became 15MB :) Ref: GS Tips Aug 25, 2012 at 10:28
  • Forgot to mention, the bookmarks were indeed preserved. But still does anyone have clues on what is getting reduced? Sep 4, 2012 at 8:12
4

@Vishnu Kumar

I'm glad you asked. Your question led me to re-examine this issue and I found out that I had extracted 100 pages from a 1000+ page PDF, using Acrobat Pro, as a test case, however that did not include the TOC bookmarks as I had assumed and that was the problem. So I opened the original large PDF in Acrobat Pro and deleted all but the first 100 pages and deleted all but the relevant bookmarks and saved that as my test case. Now the TOC is being preserved.

Here is my comparison of the two settings:

/ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.

gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -sOutputFile=reduced/output_1-102_TOC_[gs-ebook].pdf input_1-102_TOC.pdf

ridiculously slow
91.7MB-->33.4MB (36% of original)
TOC preserved
quality poor - pixellated

/printer selects output similar to the Acrobat Distiller "Print Optimized" setting.

gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dNOPAUSE -dBATCH -sOutputFile=reduced/output_1-102_TOC_[gs-printer].pdf input_1-102_TOC.pdf

fast
91.7MB-->68.9MB (75% of original)
TOC preserved
quality almost identical

Other settings:

/default selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file.

gs -sDEVICE=pdfwrite -dPDFSETTINGS=/default -dNOPAUSE -dBATCH -sOutputFile=reduced/output_1-102_TOC_[gs-default].pdf input_1-102_TOC.pdf

fast
91.7MB-->60.8MB (66% of original)
TOC preserved
quality almost identical

/prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.

gs -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -dNOPAUSE -dBATCH -sOutputFile=reduced/output_1-102_TOC_[gs-prepress].pdf input_1-102_TOC.pdf

fast
91.7MB-->80.2MB (87% of original)
TOC preserved
quality almost identical

As can be seen, the /default setting performed best, giving the smallest size for the best qualiy.

1

Ignore this and see update as a result of Vishnu Kumar's comment.

This did not work for me. Yes it reduced the size by half but with unacceptable pixellated fonts and no more bookmarks TOC, as with every other output setting I tried with gs, i.e., screen and printer. Thanks anyway…

1
  • Have you tried /ebook?? Sep 16, 2014 at 11:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .