Page 1 of 1

PDF to image conversion question

Posted: 2008-04-16T07:03:44-07:00
by armagan
When I convert a PDF file to PNG I get this rough edges all over the text. How can I convert it anti-aliased? I tried this command:

"convert -density 150 -colorspace RGB -units PixelPerInch a.pdf a.png"

You can see the screenshot of the actual PDF file and the result PNG:

Image

Re: PDF to image conversion question

Posted: 2008-04-16T07:20:39-07:00
by Bonzo
Try a higher denisty, also read the image in first. I would also look at a quality setting http://www.imagemagick.org/script/comma ... hp#quality

Code: Select all

"convert -density 400 a.pdf -colorspace RGB -units PixelPerInch a.png"

Re: PDF to image conversion question

Posted: 2008-04-16T09:26:35-07:00
by magick
Add -resize 25% if you want to reduce the final image size. Also investigate Ghostscript fonts. The default fonts are not the best and you will get better results if you provide commercial quality fonts to Ghostscript.

Re: PDF to image conversion question

Posted: 2008-04-17T01:55:34-07:00
by armagan
Higher density combined with resize did the trick, thanks a lot.

Another question: When I convert the pdf to gif it creates a single animated gif. How can I convert to separate gif files? I checked options page but couldn't see anything for this.

Re: PDF to image conversion question

Posted: 2008-04-17T06:21:59-07:00
by magick
You can create separate image files with the +adjoin option or even better embed %02d in your filename:
  • convert image.pdf image-%02d.gif

Re: PDF to image conversion question

Posted: 2008-04-17T06:46:51-07:00
by armagan
magick wrote:You can create separate image files with the +adjoin option or even better embed %02d in your filename:
  • convert image.pdf image-%02d.gif
Thanks a lot, you rock.

Re: PDF to image conversion question

Posted: 2010-05-25T19:47:50-07:00
by anthony
Of course you
1/ Have to pay for it
2/ its is windows only!

If you are going to pay for a solution I would recommend going to Adobe, the owners of the Postscript and PDF file format. But I don't know what products they have for it.

Re: PDF to image conversion question

Posted: 2010-05-25T20:09:27-07:00
by fmw42
too many post of commercial tools to convert PDF files to images recently on this forum!

Re: PDF to image conversion question

Posted: 2010-05-25T23:26:14-07:00
by anthony
Perhaps a post to the Kudos and Rants area is in order?

I don't mind hearing about alternative solutions, as long as it is only the once.
I would prefer free solutions though.

Re: PDF to image conversion question

Posted: 2016-01-25T08:51:06-07:00
by shrikantkh
Hi,
I have 55 pages pdf document and trying to convert each page in jpg/png. but getting below error, can some one please help me and tell me how we can do pdf to image conversion for multipage PDF document?


C:\ImageMagic\ImageMagick-6.9.3-1-portable-Q16-x64>convert test.pdf image-%
02d.png
convert.exe: FailedToExecuteCommand `"gswin32c.exe" -q -dQUIET -dSAFER -dBATCH -
dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEV
ICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=C
:/Temp/magick-9568gAo94o_OQzfS%d" "-fC:/Temp/magick-9568oVHaeshaJqPT" "-fC:/Temp
/magick-95680eCkiAcmOUsf"' (The system cannot find the file specified.
) @ error/delegate.c/ExternalDelegateCommand/480.
convert.exe: PDFDelegateFailed `The system cannot find the file specified.
' @ error/pdf.c/ReadPDFImage/800.
convert.exe: NoImagesDefined `image-%02d.png' @ error/convert.c/ConvertImageComm
and/3241.

Thank you
SK

Re: PDF to image conversion question

Posted: 2016-01-25T11:03:14-07:00
by fmw42
In the future, please do not tack on new questions to old topics. Also always provide your platform (as well as IM version, though you have that here).

Looks like a problem with your Ghostscript. Do you have it installed?