error converting PDF->JPG

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
lowglow

error converting PDF->JPG

Post by lowglow »

using the command on linux 'convert file.pdf file%05d.jpg',

'convert' will begin converting the pages of the pdf, but will fail at the 206/1050 page with the error :

Error: /invalidfont in findfont
Operand stack:
--dict:8/8(L)-- T1_1 1 --dict:4/4(L)-- --dict:4/4(L)-- Courier Font Courier 1425574 Courier --nostringval-- Courier NimbusMonL-Regu (NimbusMonL-Regu) NimbusMonL-Regu (NimbusMonL-Regu) NimbusMonL-Regu
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- 209 1 208 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- 6 9 %oparray_pop 7 9 %oparray_pop --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 10 10 %oparray_pop --nostringval-- --nostringval-- --nostringval-- 5 -1 1 --nostringval-- %for_neg_int_continue --nostringval-- --nostringval--
Dictionary stack:
--dict:1062/1417(ro)(G)-- --dict:0/20(G)-- --dict:73/200(L)-- --dict:73/200(L)-- --dict:97/127(ro)(G)-- --dict:229/230(ro)(G)-- --dict:19/24(L)-- --dict:4/6(L)-- --dict:24/31(L)-- --dict:17/17(ro)(G)-- --dict:1062/1417(ro)(G)--
Current allocation mode is local
Last OS error: 2
ESP Ghostscript 7.07.1: Unrecoverable error, exit code 1
convert: Postscript delegate failed `th.pdf'.


using version:
Version: ImageMagick 6.2.4 09/16/06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2005 ImageMagick Studio LLC




Can anyone recommend a solution?
lowglow

Re: error converting PDF->JPG

Post by lowglow »

I just tried to issue the command : gs -sDEVICE=jpeg -sOutputFile=test.jpg test.pdf

Can't find (or can't open) font file n022003l.pfb.
Can't find (or can't open) font file /usr/share/ghostscript/fonts/NimbusMonL-Regu.
Can't find (or can't open) font file NimbusMonL-Regu.
Can't find (or can't open) font file /usr/share/ghostscript/fonts/NimbusMonL-Regu.
Can't find (or can't open) font file NimbusMonL-Regu.
Unable to substitute for font.
Error: /invalidfont in findfont
Operand stack:
--dict:8/8(L)-- T1_1 1 --dict:4/4(L)-- --dict:4/4(L)-- Courier Font Courier 1896989 Courier --nostringval-- Courier NimbusMonL-Regu (NimbusMonL-Regu) NimbusMonL-Regu (NimbusMonL-Regu) NimbusMonL-Regu
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- 209 1 1323 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- 6 9 %oparray_pop 7 9 %oparray_pop --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 10 10 %oparray_pop --nostringval-- --nostringval-- --nostringval-- 5 -1 1 --nostringval-- %for_neg_int_continue --nostringval-- --nostringval--
Dictionary stack:
--dict:1054/1417(ro)(G)-- --dict:0/20(G)-- --dict:73/200(L)-- --dict:73/200(L)-- --dict:97/127(ro)(G)-- --dict:229/230(ro)(G)-- --dict:19/24(L)-- --dict:4/6(L)-- --dict:24/31(L)-- --dict:17/17(ro)(G)-- --dict:1054/1417(ro)(G)--
Current allocation mode is local
Last OS error: 2
ESP Ghostscript 7.07.1: Unrecoverable error, exit code 1










Is there anyway I can force the font to another available font when it can't find the font it desires?


Here is a list of my fonts :

Path: /usr/lib/ImageMagick-6.2.4/config/type-ghostscript.xml

Name Family Style Stretch Weight
--------------------------------------------------------------------------------
AvantGarde-Book AvantGarde Normal Normal 400
AvantGarde-BookOblique AvantGarde Oblique Normal 400
AvantGarde-Demi AvantGarde Normal Normal 600
AvantGarde-DemiOblique AvantGarde Oblique Normal 600
Bookman-Demi Bookman Normal Normal 600
Bookman-DemiItalic Bookman Italic Normal 600
Bookman-Light Bookman Normal Normal 300
Bookman-LightItalic Bookman Italic Normal 300
Courier Courier Normal Normal 400
Courier-Bold Courier Normal Normal 700
Courier-BoldOblique Courier Oblique Normal 700
Courier-Oblique Courier Oblique Normal 400
Helvetica Helvetica Normal Normal 400
Helvetica-Bold Helvetica Normal Normal 700
Helvetica-BoldOblique Helvetica Italic Normal 700
Helvetica-Narrow Helvetica Narrow Normal Condensed 400
Helvetica-Narrow-Bold Helvetica Narrow Normal Condensed 700
Helvetica-Narrow-BoldOblique Helvetica Narrow Oblique Condensed 700
Helvetica-Narrow-Oblique Helvetica Narrow Oblique Condensed 400
Helvetica-Oblique Helvetica Italic Normal 400
NewCenturySchlbk-Bold NewCenturySchlbk Normal Normal 700
NewCenturySchlbk-BoldItalic NewCenturySchlbk Italic Normal 700
NewCenturySchlbk-Italic NewCenturySchlbk Italic Normal 400
NewCenturySchlbk-Roman NewCenturySchlbk Normal Normal 400
Palatino-Bold Palatino Normal Normal 700
Palatino-BoldItalic Palatino Italic Normal 700
Palatino-Italic Palatino Italic Normal 400
Palatino-Roman Palatino Normal Normal 400
Symbol Symbol Normal Normal 400
Times-Bold Times Normal Normal 700
Times-BoldItalic Times Italic Normal 700
Times-Italic Times Italic Normal 400
Times-Roman Times Normal Normal 400
Last edited by lowglow on 2010-02-21T18:44:50-07:00, edited 1 time in total.
lowglow

Re: error converting PDF->JPG

Post by lowglow »

I'm curious why I even need it to read fonts if I'm just converting it to jpeg.

Is there anyway I can force it to just not care about fonts, and take a "screenshot" of the page or something without having to process any fonts?
Last edited by lowglow on 2010-02-21T18:45:05-07:00, edited 1 time in total.
lowglow

Re: error converting PDF->JPG

Post by lowglow »

OR is there a way I can FORCE it to use a different font altogether (rather than NimbusMonL-Regu)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: error converting PDF->JPG

Post by snibgo »

Those are questions about ghostscript, not ImageMagick. I suggest you ask in ghostscript forums.

(Hint: you might search for "ghostscript Unable to substitute for font".)
snibgo's IM pages: im.snibgo.com
lowglow

Re: error converting PDF->JPG

Post by lowglow »

I've found the font on the server and placed it in the local directory so that solved the first problem. Then on page 355/1035 this error comes up :

Error: /rangecheck in --.buildfont11--
Operand stack:
--dict:8/8(L)-- C2_1 1 --dict:6/6(L)-- --dict:6/6(L)-- CGIMPN+SymbolMT --dict:9/12(ro)(G)-- --nostringval-- --dict:7/7(L)-- --dict:7/7(L)-- 2208581 --dict:7/7(L)-- (800005CA) --dict:13/20(L)-- CIDFont (800005CA) (800005CA) --dict:13/20(L)--
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- 356 1 1323 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- 15 9 %oparray_pop --nostringval-- --nostringval-- --nostringval-- 17 10 %oparray_pop --nostringval-- --nostringval-- --nostringval--
Dictionary stack:
--dict:1060/1417(ro)(G)-- --dict:0/20(G)-- --dict:73/200(L)-- --dict:73/200(L)-- --dict:97/127(ro)(G)-- --dict:229/230(ro)(G)-- --dict:19/24(L)-- --dict:4/6(L)-- --dict:24/31(L)-- --dict:16/24(ro)(G)--


I don't understand what this even means. any hints?
lowglow

Re: error converting PDF->JPG

Post by lowglow »

snibgo wrote:Those are questions about ghostscript, not ImageMagick. I suggest you ask in ghostscript forums.

(Hint: you might search for "ghostscript Unable to substitute for font".)

Thanks, I fixed my error by moving the font to the local directory, see above for new error. :(


Also, I tried looking for ghostscript forums but can't seem to find one, any links?
Post Reply