Page 1 of 1

Convert PDF with font-size changes with density

Posted: 2011-04-18T02:01:46-07:00
by akulabi
Hi everyone,

I try to convert single pdf file with several traditional chinese fonts to image (png,jpg) with convert command.

Sample file: test.pdf

Code: Select all

convert -density 300 test.pdf test.png
Some output characters has smaller font size than original document, as shown in the thumbnail images below:
Density 100
Density 300
Density 500
Density 700

I try to increase the density parameter and the characters grow larger. They grow to normal size when density reach 700.
However, as density increases, the conversion time becomes lengthy (> 3 sec per page).

I am using ImageMagick 6.6.5 Q 16 on windows 7 (and windows XP), using convert command on command prompt.

Anyone has idea to convert correctly, or shorten the conversion time? Thanks!

Dennis

Re: Convert PDF with font-size changes with density

Posted: 2011-04-18T04:35:21-07:00
by anthony
First a lot of fonts only work at specific densities, As such the character sizes may suddeny jump. That depends on the font and the font designer.

Second as the density increases the number of pixels increase. This is a squared ratio. Double the density and you have 4 times the number of pixels. Also it means more I/O and eventually memory limits will cause disk caching to slow it down even more.

Re: Convert PDF with font-size changes with density

Posted: 2011-04-18T22:57:30-07:00
by akulabi
Thanks for the clear response.

Is there any method to shorten the time of pdf conversion if the density is required to be 700?
e.g. resize, compress before conversion, use gs directly

Thanks,
Dennis

Re: Convert PDF with font-size changes with density

Posted: 2011-04-18T23:35:40-07:00
by anthony
Better method to reduce time is to do the gs conversion yourself, and pipe the results into IM "convert" to convert it to the final image format (with whatever other image modifications needed.

IM does a lot of double handling for GS, due to security requirements, :-( that is best avoided if possible.

Re: Convert PDF with font-size changes with density

Posted: 2011-04-19T03:46:59-07:00
by akulabi
It is clear. Thanks a lot =)