Converting PDF page to image missing accentuated characters

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Uonze
Posts: 4
Joined: 2014-07-02T04:23:43-07:00
Authentication code: 6789

Converting PDF page to image missing accentuated characters

Post by Uonze »

I’m converting page 3 from this PDF to a JPEG:
https://drive.google.com/file/d/0B7PFCA ... sp=sharing

This is the resulting image:
https://drive.google.com/file/d/0B7PFCA ... sp=sharing

I'm using this command:

Code: Select all

convert -verbose -quality 85 -density 150 multi.pdf[2] -resample 150 1.jpg
No errors are displayed in verbose mode.

The text is in Portuguese, but accentuated characters from the text are missing. For example the title should be "Gestão da inovação" instead of "Gest o da inovaç o". This happens in all pages from this PDF.
I have checked and I have freetype in the DELEGATES tag.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting PDF page to image missing accentuated charact

Post by snibgo »

It converts fine for me, IM v6.8.9-0 on Windows 8.1, using Ghostscript v9.10. What are you running? If old software, an upgrade may cure it.
snibgo's IM pages: im.snibgo.com
Uonze
Posts: 4
Joined: 2014-07-02T04:23:43-07:00
Authentication code: 6789

Re: Converting PDF page to image missing accentuated charact

Post by Uonze »

I'm using Imagemagick 6.7.7-10 running on Ubuntu 14.04
Uonze
Posts: 4
Joined: 2014-07-02T04:23:43-07:00
Authentication code: 6789

Re: Converting PDF page to image missing accentuated charact

Post by Uonze »

Updated to 6.8.9-5 still not working, could be a problem with fonts?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting PDF page to image missing accentuated charact

Post by snibgo »

Yeah, that's over 1000 versions old, and many years. I suggest you upgrade. Do Ghostscript as well.

EDIT: We cross-posted. Did you also upgrade GS?
snibgo's IM pages: im.snibgo.com
Uonze
Posts: 4
Joined: 2014-07-02T04:23:43-07:00
Authentication code: 6789

Re: Converting PDF page to image missing accentuated charact

Post by Uonze »

Updating ghostscript solved the problem. Thank you snibgo!
vfranchi
Posts: 4
Joined: 2015-07-30T07:34:51-07:00
Authentication code: 1151

Re: Converting PDF page to image missing accentuated characters

Post by vfranchi »

Hi, I am having the same issue. I am using Uonze PDF to test this.

I was using ImageMagick 6.7.7 and Ghostscript 9.10 on an Ubuntu 14.04 server and I was getting the same errors. So I tried updating, I manually installed ImageMagick 6.8.9-10. Later, I added Ubuntu's 15.04 repository to apg-get so I was able to install Ghostscript 9.15. But still, I have these errors with accent characters.

I tried using /convert command or /gs directly to convert the PDF and the issue is always there. My latest attempts was using these commands:

Code: Select all

gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=jpeg -sOutputFile=gs-test.jpg -dFirstPage=3 -dLastPage=3 -dRENDERTTNOTDEF=1 multi.pdf

Code: Select all

/opt/imagemagick-6.8/bin/convert multi.pdf[2] -alpha off -resize '1024x1024' -quality '75' im-test.jpg
These are the versions installed:

Code: Select all

gs -v
GPL Ghostscript 9.15 (2014-09-22)
Copyright (C) 2014 Artifex Software, Inc.  All rights reserved.

/opt/imagemagick-6.8/bin/convert --version
Version: ImageMagick 6.8.9-10 Q16 x86_64 2015-07-30 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: jng jpeg png x xml zlib
Any ideas on how to fix this?

EDIT: I installed ImageMagick on a Mac OS, and it's converting the PDF file correctly. I'm starting to think it's a problem with FreeType library or something related to that. As you can see, freetype is not declared on the Delegates of ImageMagick 6.8.9 that I manually installed. But it't declared on the ImageMagick 6.7.7 from the Ubuntu's official repository:

Code: Select all

$ convert -version
Version: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP    

$ convert -list configure |grep DELEGATES
DELEGATES     bzlib djvu fftw fontconfig freetype jbig jpeg jng jp2 lcms2 lqr lzma openexr pango png rsvg tiff x11 xml wmf zlib
vfranchi
Posts: 4
Joined: 2015-07-30T07:34:51-07:00
Authentication code: 1151

Re: Converting PDF page to image missing accentuated characters

Post by vfranchi »

The problem was the Ghostscript version, 9.15 is not enough. Version 9.16 fixed the error.
vpmammana
Posts: 37
Joined: 2015-12-06T14:13:46-07:00
Authentication code: 1151

Re: Converting PDF page to image missing accentuated characters

Post by vpmammana »

By the way, how did you update the version 6.7.7 to 6.8 in Ubuntu?

I tried to follow some of the suggestions present on this website, but those did not work.

Could you please give a clue on how to update the version in Ubuntu 14.something?
vfranchi
Posts: 4
Joined: 2015-07-30T07:34:51-07:00
Authentication code: 1151

Re: Converting PDF page to image missing accentuated characters

Post by vfranchi »

vpmammana wrote:By the way, how did you update the version 6.7.7 to 6.8 in Ubuntu?

I tried to follow some of the suggestions present on this website, but those did not work.

Could you please give a clue on how to update the version in Ubuntu 14.something?
You can download the official binary package for linux x64 at Ghostscript website: http://downloads.ghostscript.com/public/binaries/
I, personally, just replaced the /usr/bin/gs binary with the new one.

If you need more info, check this post on askubuntu: http://askubuntu.com/questions/654773/p ... ima/661436
vpmammana
Posts: 37
Joined: 2015-12-06T14:13:46-07:00
Authentication code: 1151

Re: Converting PDF page to image missing accentuated characters

Post by vpmammana »

I used the following way:

viewtopic.php?t=24284
Post Reply