Missing fonts for PDF to JPG from command line

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
jggretton
Posts: 7
Joined: 2007-03-14T10:18:19-07:00

Missing fonts for PDF to JPG from command line

Post by jggretton »

Hello, I keep getting errors because I don't have the necessary fonts installed for imagemagick to convert my pdfs to images.

Code: Select all

Error: /invalidfont in findfont
Operand stack:
  --dict:6/6(L)--   F0   35   --dict:4/4(L)--   --dict:4/4(L)--   Helvetica   Helvetica   Font   Helvetica   1190552   Helvetica   --nostringval--   Helvetica   NimbusSanL-Regu   Courier   NimbusMonL-Regu......etc.
I was just wondering if anyone knew of a way round this like automatically substituting fonts or something - i'd rather get a final pdf with out of line text or missing text than just an error message and no image!

Thanks a lot for any help you can give me,

James
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Missing fonts for PDF to JPG from command line

Post by anthony »

Looks like Ghostscript is mis-installed.. Ghostscripts fonts are usally installed as a seperate package to the program itself. (program verses data).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
jggretton
Posts: 7
Joined: 2007-03-14T10:18:19-07:00

Re: Missing fonts for PDF to JPG from command line

Post by jggretton »

Ah! How interesting! Some PDF's do convert, for instance I've just tried one with only Arial fonts in it and it worked fine. Does this fit with your suggestion of GhostScript not being properly installed?

If so, could you give me any details that I might be able to say to my web hosts in order to convince them that somethings up and i'm not just another winey customer!

Thanks a lot for your help,

James
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Missing fonts for PDF to JPG from command line

Post by anthony »

Give then a pdf that ghostscript is not converting properly!

ghostscript is independant of the PHP program stack so they should not feel it is a lot of work.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
kim_earth

Re: Missing fonts for PDF to JPG from command line

Post by kim_earth »

I'm having the same issue actually.

I'm using ghostscript 8.51.

Some of my pdfs identify no problem, some of them throw the following error:

Code: Select all

Error: /invalidfont in findfont
Operand stack:
   --dict:7/7(L)--   T1_37   1   --dict:8/8(L)--   --dict:8/8(L)--   Helvetica-Condensed   --dict:11/11(L)--   Helvetica-Narrow   Helvetica-Narrow   Font   Helvetica-Narrow   705
006   Helvetica-Narrow   --nostringval--   Helvetica-Narrow   NimbusSanL-ReguCond
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   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   1   --nostringval--   %for_pos_int_continue   --nostringv
AFPL Ghostscript 8.51: Unrecoverable error, exit code 1
al--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--   
--nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   9   9   %oparray_pop   10   9   %oparray_pop   --nostringval--   --nostringval--   --nos
tringval--   --nostringval--   --nostringval--   false   1   %stopped_push   13   10   %oparray_pop   --nostringval--   --nostringval--   --nostringval--   1   -1   1   --nostrin
gval--   %for_neg_int_continue
Dictionary stack:
   --dict:1126/1686(ro)(G)--   --dict:0/20(G)--   --dict:75/200(L)--   --dict:75/200(L)--   --dict:105/127(ro)(G)--   --dict:251/347(ro)(G)--   --dict:21/24(L)--   --dict:4/6(L)-
-   --dict:25/32(L)--   --dict:17/17(ro)(G)--   --dict:1126/1686(ro)(G)--
Current allocation mode is local
Last OS error: 2
identify: Postscript delegate failed
The only difference I can see in the pdf properties is that the ones that work contain type 1 fonts and the ones that don't work contain a true type font - not sure if this has anything to do with it.

My ghostscript shows the paths as:

Code: Select all

Search path:
   . : /usr/local/share/ghostscript/8.51/lib :
   /usr/local/share/ghostscript/8.51/Resource :
   /usr/local/share/ghostscript/fonts
however, there is no folder 'fonts' under /usr/local/share/ghostscript.

Does anyone know where I'm supposed to grab these? I can't find anything on the GS site.


edit: I just figured out my own question :)

ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/fonts/

went there and grabbed the ghostscript fonts.. put them in /usr/local/share/ghostscript and now all is good :)
Post Reply