Conversion from PDF to PNG invalid text after render

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
cristiandl
Posts: 2
Joined: 2019-05-22T05:15:39-07:00
Authentication code: 1152

Conversion from PDF to PNG invalid text after render

Post by cristiandl »

Hello,

I have a problem with the conversion of a PDF file to PNG. When I execute the process, the image rendered shows a invalid text characters with rectangles, and wrong format.

I'm using the following sentence to convert the PDF.

magick /in/Supplier_COA_with_DocID_0024817765BA1ED99A80D323F6E30D00.pdf -density 300 -quality 100 -colorspace sRGB -background white /out/CERTIFICATE.png

The problem just happens with a few PDF. I think that the problem is the font of embedded in the PDF, if I open the PDF with Word the fornts are Courier and Arial. These fonts are installed in the server.

This is the PDF original. I hidded the customer fields

https://imagizer.imageshack.com/img924/7716/zajoYM.png

Converted PNG file

https://imagizer.imageshack.com/img921/4931/710wpf.jpg

I need your help is a very critical issue for my customer that I must fix.

Thanks a lot.

Best regards,
Christian
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Conversion from PDF to PNG invalid text after render

Post by snibgo »

cristiandl wrote:if I open the PDF with Word the fornts are Courier and Arial.
But Word may have substituted fonts. What does Adobe Acrobat Reader say about the fonts?
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: Conversion from PDF to PNG invalid text after render

Post by fmw42 »

Your link is to a PNG and not the PDF file. Your command should set the density before reading the PDF. This may not help the font issue. Just pointing out proper syntax. Also -quality 100 may not be appropriate for PNG. Quality values are different for PNG than for JPG. See https://imagemagick.org/script/command- ... hp#quality. Have you downloaded and installed the Ghostscript fonts? See https://imagemagick.org/download/delegates/ for a link to them. Are you using a current version of Ghostscript. Note that I have heard of issues with both GS 9.26 and 9.27. So I would recommend using 9.23, 9.24, or 9.25
cristiandl
Posts: 2
Joined: 2019-05-22T05:15:39-07:00
Authentication code: 1152

Re: Conversion from PDF to PNG invalid text after render

Post by cristiandl »

The purpose is the conversion from PDF to PNG file to include it in a scheduled process. These sentence with a concrete PDF works fine but with some others doesn't work. I will check the ghostscript fonts to verify if I missing something.
Post Reply