Page 1 of 1

Special character not rendered when converting PDF to image

Posted: 2014-09-05T07:32:52-07:00
by mongolito404
Hi,

I'm using the following command to convert (the first page of) a PDF file to an image.

Code: Select all

convert '/path/to/file.pdf[0]' -alpha off -resize '1024x1024' -quality '75' '/tmp/file.jpg'
This work well, except when using a PDF file containing special characters such as é or ô.

My understanding is that ImageMagick support special characters (in UTF-8) and should render them correctly if the font provides glyphs for them. So my hypothesis is that the PDF uses a font (either by name of embeded in the PDF) that does not provide glyphs that ImageMagick can uses. Off course, the PDF render fine in Adobe reader and other PDF viewer (including Gnome's evince on the same computer).

Iv'e no idea how to validate my hypothesis and how to fix it. It may also be completely wrong and an easy solution may be available.

Any idea?

Note: see https://wada-main-sandbox.s3.amazonaws. ... A4-Web.pdf for a sample PDF file that causes the issue.

Re: Special character not rendered when converting PDF to im

Posted: 2014-09-05T08:04:37-07:00
by snibgo
It converts fine for me. IM calls Ghostscript to rasterise PDFs, and GS may not have a suitable font. You might try upgrading/reinstalling GS.

Re: Special character not rendered when converting PDF to im

Posted: 2014-09-05T09:55:00-07:00
by mongolito404
I'm using ImageMagick 6.7.7-10 with Ghostscript 9.10 on Ubuntu 14.04.1 LTS, I've installed the gsfonts gsfonts-other packages.

Which version on Ghostscript do you have, on which platform are you running ?

Re: Special character not rendered when converting PDF to im

Posted: 2014-09-05T23:54:43-07:00
by snibgo
IM v6.8.9-5, GS 9.10, on Windows 8.1.

Re: Special character not rendered when converting PDF to im

Posted: 2014-09-06T10:25:09-07:00
by fmw42
Works fine for me on IM 6.8.9.7 Q16 Mac OSX with GS 9.10