Page 1 of 1

Conversion from PDF to PNG invalid text after render

Posted: 2019-05-22T05:31:50-07:00
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

Re: Conversion from PDF to PNG invalid text after render

Posted: 2019-05-22T06:31:59-07:00
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?

Re: Conversion from PDF to PNG invalid text after render

Posted: 2019-05-22T08:56:55-07:00
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

Re: Conversion from PDF to PNG invalid text after render

Posted: 2019-06-12T03:31:46-07:00
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.