You are currently browsing the Carl’s notes weblog archives for October, 2008.

Converting PDF to PNG

OpenOffice doesn’t currently let me include PDFs. The following command uses ghostscript to convert the first page of a PDF to a PNG image with a resolution of 300dpi.

gs -q -sDEVICE=png16m -dBATCH -dNOPAUSE -dFirstPage=1 -dLastPage=1 -r300 -sOutputFile=output.png input.pdf

Thanks to a post by gosha bine.