Linux/ImageMagick: convert first page of pdf document to small jpeg preview

convert -density 144 myfile.pdf[0] -resize 10% -background white -alpha remove -strip -quality 90 mypreview.jpg
I needed a little document preview in my web app. This was the fastest and best solution I got. It uses the amazing imagemagick utility named "convert".

myfile.pdf[0] = only first page

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.