Special character not rendered when converting PDF to image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
mongolito404
Posts: 2
Joined: 2014-09-05T07:12:47-07:00
Authentication code: 6789

Special character not rendered when converting PDF to image

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Special character not rendered when converting PDF to im

Post 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.
snibgo's IM pages: im.snibgo.com
mongolito404
Posts: 2
Joined: 2014-09-05T07:12:47-07:00
Authentication code: 6789

Re: Special character not rendered when converting PDF to im

Post 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 ?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Special character not rendered when converting PDF to im

Post by snibgo »

IM v6.8.9-5, GS 9.10, on Windows 8.1.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Special character not rendered when converting PDF to im

Post by fmw42 »

Works fine for me on IM 6.8.9.7 Q16 Mac OSX with GS 9.10
Post Reply