Page 1 of 1

Converting PDF page to image missing accentuated characters

Posted: 2014-07-02T04:38:48-07:00
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.

Re: Converting PDF page to image missing accentuated charact

Posted: 2014-07-02T05:55:59-07:00
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.

Re: Converting PDF page to image missing accentuated charact

Posted: 2014-07-02T07:20:51-07:00
by Uonze
I'm using Imagemagick 6.7.7-10 running on Ubuntu 14.04

Re: Converting PDF page to image missing accentuated charact

Posted: 2014-07-02T08:18:49-07:00
by Uonze
Updated to 6.8.9-5 still not working, could be a problem with fonts?

Re: Converting PDF page to image missing accentuated charact

Posted: 2014-07-02T08:19:31-07:00
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?

Re: Converting PDF page to image missing accentuated charact

Posted: 2014-07-02T10:03:04-07:00
by Uonze
Updating ghostscript solved the problem. Thank you snibgo!

Re: Converting PDF page to image missing accentuated characters

Posted: 2015-07-30T07:54:08-07:00
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

Re: Converting PDF page to image missing accentuated characters

Posted: 2015-08-14T08:23:24-07:00
by vfranchi
The problem was the Ghostscript version, 9.15 is not enough. Version 9.16 fixed the error.

Re: Converting PDF page to image missing accentuated characters

Posted: 2015-12-19T20:30:31-07:00
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?

Re: Converting PDF page to image missing accentuated characters

Posted: 2015-12-20T09:22:50-07:00
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

Re: Converting PDF page to image missing accentuated characters

Posted: 2015-12-26T15:35:26-07:00
by vpmammana
I used the following way:

viewtopic.php?t=24284