Felipe Barriga Richards Blog

Blog personal de Felipe Barriga Richards
May 12, 2010

Easy crop a PDF in Linux/Unix

Delicious Delicious Facebook Facebook TwitterTwitter Categories: Linux - Tags: , ,

Sometimes somebody send you a pdf with big white margins that only annoy you. This is often when you receive Power Point presentations in pdf format so is almost impossible to print several slides on one page.


PDF Before Conversion

Before

PDF After Conversion

After


To avoid this you can crop the pdf pages and remove those margins.
Read it all..

April 13, 2010

Convert big PDF to huge image (maps)

Delicious Delicious Facebook Facebook TwitterTwitter Categories: Otros - Tags: ,

To convert PDF to big images like maps you can try with Gimp but it eat too much memory and is a bit slow.
The other option is to use ImageMagick:

felipe@funstation:$ convert file.pdf file.jpg

If the output image is to small you can try to change the pixel density (dpi) which is 72dpi by default to a bigger one.
Here is an example using 500dpi, 8 bits of color (256), inverting the colors (negate) and saving it in PNG format:

felipe@funstation:$ convert -density 500 -negate -depth 8 base_actualizado_diciembre_2009.pdf base_actualizado_diciembre_2009-500-invert-8bits.png

The sample file is here: http://www.osornochile.cl/webimo/documentos/base_actualizado_diciembre_2009.pdf
The PDF size is 7.5M and the output PNG size is 59M.