Friday, June 12, 2009

SoFoBoMo hint for Mac and Pages users: reduce PDF filesize from 161 MB to 8 MB


Eaten, originally uploaded by jiihaa.

Although I finished my SoFoBoMo project some time ago, yesterday I generated a new version of the PDF file (7.7 MB).

I produced the new PDF file using GhostScript to compress the original "best" quality PDF output from Pages (file size 160.7 MB). Compression by GhostScript decreased the file size by 1/20. The resulting file is much better quality than using the worst quality setting in exporting the PDF file from Pages, which generated a 4 MB file. In fact, the result seems to be better than the 20 MB PDF file generated by the medium quality setting in Pages.

It seems that when using the "best" PDF output setting, Pages includes the image files as they are. The Pages document size is 160.8 MB and the PDF file is 160.7 MB. Using the lesser quality output settings cuts down the document size significantly, but Pages is doing a worse job than GhostScript in terms of image quality vs. file size.

Have a look at a hint on reducing the file size of a PDF. The needed GhostScript command is this:

gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=BK_low.pdf -dPDFSETTINGS=/ebook BK.pdf
On a Mac, you need to use Terminal for this; GhostScript is pre-installed. The command can take several minutes to run.

The image here is from Thursday. It was a nice day. I got 3.5 hours of exercise in all, which was a bit too much, but it was needed anyway.

Update: I found another good GhostScript hint, on how to convert a PDF document into individual jpeg image files. (But I used 300 dpi instead of 150 as the output resolution.) I'm testing whether this is the best way to make a Blurb book out of the PDF document.

No comments: