Invalidfont while converting PDF to JPG
Posted: 2012-01-24T06:58:52-07:00
Hi All. I new user in ImageMagick. I got problem while converting pdf file into jpg image using convert command via PHP Function (system, exec, shell_exec) on my web hosting. First, I try this command :
But error message appear like this :
I try to see font that installed on system using this command:
And it turns out this font (Helvetica) has been installed in the system. And this is half of output:
I was browse to many source and most of them suggest me to use -font argument to specify / self define like this:
and also try another variant way, hoping to do the conversion using another font type like this:
or
But that way also didn't change the condition. It's any way to fixed the problem without configure operating system. Because I use web hosting to do that and didn't have permission to configure operating system.
Thank's for replay. Best Regards.
Code: Select all
convert foo.pdf foo.jpg
Code: Select all
Error: /invalidfont in /findfont
Operand stack:
--dict:9/18(L)-- F1 1 --dict:4/4(L)-- --dict:4/4(L)-- Helvetica Helvetica
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1846 1 3 %oparray_pop 1845 1 3 %oparray_pop 1829 1 3 %oparray_pop --nostringval-- --nostringval-- 3 1 2 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- 1804 7 9 %oparray_pop
Dictionary stack:
--dict:1159/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:106/127(ro)(G)-- --dict:285/300(ro)(G)-- --dict:22/25(L)-- --dict:4/6(L)-- --dict:26/40(L)--
Current allocation mode is local
Last OS error: 2
Code: Select all
convert -list font
Code: Select all
Path: /usr/lib64/ImageMagick-6.4.8/config/type-ghostscript.xml
Font: Helvetica
family: Helvetica
style: Normal
stretch: Normal
weight: 400
glyphs: /usr/share/fonts/default/Type1/n019003l.pfb
Code: Select all
convert -font Helvetica foo.pdf foo.jpg
Code: Select all
convert -font Bitstream-Vera-Sans-Roman foo.pdf foo.jpg
Code: Select all
convert -font /mypath/Arial.ttf foo.pdf foo.jpg
Thank's for replay. Best Regards.