Wednesday, February 13, 2013

Reducing the file size of PDF documents

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

I recently made a nice pdf figure using R but the file was 18Mb heavy. With 7 such figures my manuscript was easily crossing the 100Mb mark which felt rather unnecessary. The command above scales down the18Mb file to a tenth of its size. Since these figures are based on vectors, scaling down the file size has little to no impact on the quality of the figure when zoomed in. gs is turning out to be far more potent than I initially thought.

No comments:

Post a Comment