You are here: Re: Convert a pdf to an image format with imagemagick « PHP Programming Language « IT news, forums, messages
Re: Convert a pdf to an image format with imagemagick

Posted by gosha bine on 07/24/07 07:54

On 23.07.2007 17:26 femtox77@gmail.com wrote:
> Hi to all!!!
>
> I'm trying to convert a pdf file into an image, for example JPG or PNG
> format, with ImageMagick. I use the command line. For example: convert
> header.pdf header.jpg. But I obtain a bad result. The jpg's quality is
> very low. Why? I tried to use - quality 100 option but there isn't
> improvement. I think also that this option isn't active for the pdf
> conversion to an image format or not? I need some good ideas :D...
>
> Thanks to all
>
> fem
>

hi there

ImageMagick doesn't actually convert pdfs, all it does is to invoke
Ghostscript. You might want to call GS directly to gain more control
over it. Example of a GS command:

gs -q -sDEVICE=jpeg -dBATCH -dNOPAUSE -dFirstPage=1 -dLastPage=1
-r<OUTPUT RESOLUTION> -sOutputFile=<OUTPUT>.jpg <INPUT>.pdf 2>&1

this rasterizes first page of <INPUT>.pdf into <OUTPUT>.jpg with
resolution 300.



--
gosha bine

makrell ~ http://www.tagarga.com/blok/makrell
php made right ;) http://code.google.com/p/pihipi

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация