PDF to PNG Conversion

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
msamarnath
Posts: 2
Joined: 2012-02-11T03:10:03-07:00
Authentication code: 8675308

PDF to PNG Conversion

Post by msamarnath »

Hi All,

I am very new to this ImageMagick and to this forum. I am trying to convert bunch of PDFs to PNGs and in some pages, I am not able to get the text fonts converted to PNG as it is in the PDF. I am using the following command to convert the PDF to PNG and this PNGs need to be used on Mobile devices.

convert -density 144 -quality 100 -colorspace RGB -define pdf:use-cropbox=true "page1.pdf[0]" "page1.png"

I am just converting the page which has the issue and the problem is there are inconsistent spaces between the letters of the texts when it is converted to PNG.

The below URL has got the PDF which has the issue
http://cst-ts.excelindia.com/download/page1.pdf

The below Image is converted from the above command
http://cst-ts.excelindia.com/download/page1.png

Can anyone please help me to understand what could be the issue here and the solution to resolve this.

Many Thanks,
msamarnath
Posts: 2
Joined: 2012-02-11T03:10:03-07:00
Authentication code: 8675308

Re: PDF to PNG Conversion

Post by msamarnath »

On Investigating the issue further, I found that some of the fonts are not embedded inside the PDF and also not found in my system. Is that can be a issue?
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: PDF to PNG Conversion

Post by Drarakel »

msamarnath wrote:Is that can be a issue?
Yeah. The "CenturyGothic" font is not embedded.
You probably have to:
a) get this font somewhere (on my Windows system, it was installed with Office, I guess) and
b) assure that Ghostscript can load the font (for example by specifying the path to this file with the GS_FONTPATH environment variable)

Then it should be better. (Though, on my system, Ghostscript and the Adobe Reader still use different fonts. Not sure why.)
Post Reply