четвъртък, 7 февруари 2013 г.

How to reduce the size of a pdf

I needed to send a pdf, and it turned out way to big. Well, it was big, no doubt, since it consisted of 3 high-quality pictures, but anyway.
So, here's what I did.
$pdf2ps file.pdf file.ps
$ps2pdf file.ps file_.pdf
And the pdf got like 3 times smaller. Which was good. 

Essentially, you can achieve the same by opening the pdf in Okular and doing a print to pdf - this is how I did it the first time. 

There is, of course, the longer option: 

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

where you can replace "/screen" with "/ebook", "/printer" or "/prepress" for higher quality (/screen being the worst, /prepress - the best). But if you increase the quality, the pdf will remain BIG. And for once, we want it smaller. :)


convert -density 180x180 -quality 50 -compress jpeg Mercadona_Shtereva.pdf Mercadona.pdf

Няма коментари:

Публикуване на коментар