Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert PDF to PNG using ImageMagick

using ImageMagick, what command should i use to convert a PDF to PNG? I need highest quality, smallest file size. this is what I have so far (very slow by the way):

convert -density 300 -depth 8 -quality 85 a.pdf a.png 

Looking at what Gmail does when a user "view" a PDF, the quality is awesome and the file size very minimal. The DPI is just 96 (I have to set a density of 300 to get anything decent). Anyone know how GMail does it? Thanks.

like image 905
StackOverflowNewbie Avatar asked May 19 '10 22:05

StackOverflowNewbie


1 Answers

Reducing the image size before output results in something that looks sharper, in my case:

convert -density 300 a.pdf -resize 25% a.png 
like image 57
Alastair Avatar answered Oct 03 '22 09:10

Alastair