0

In Linux, please, how do I direct output from a ghostscript program to my HP LaserJet printer? My eventual aim is to draw maps to scale from Natural Earth data .

A test page from the printer is perfect, with the mm scales exactly matching my ruler, so the software to produce printer output must be already there.

This is my test program to draw a rectangle 86.6 (x) by 173.2 (y) mm

%!
/Helvetica findfont 36 scalefont setfont
/mm { 25.4 div 72 mul }def
    newpath
    50.8 mm 101.6 mm moveto
    50.8 mm 101.6 mm 173.2 mm add lineto
    50.8 86.6 add mm 101.6 173.2 add mm lineto
    50.8 86.6 add mm 101.6 mm lineto
    closepath
    stroke
showpage

And this is what I have tried, with the result. As I am not using text I have ignored the error messages so far.:

% gs -sOutputFile=HP_LaserJet_Professional_P_1102w GhostScript/Grid02.ps
GPL Ghostscript 9.14 (2014-03-26)
Copyright (C) 2014 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Can't find (or can't open) font file /usr/share/ghostscript/9.14/Resource/Font/NimbusSanL-Regu.
Can't find (or can't open) font file NimbusSanL-Regu.
Can't find (or can't open) font file /usr/share/ghostscript/9.14/Resource/Font/NimbusSanL-Regu.
Can't find (or can't open) font file NimbusSanL-Regu.
Querying operating system for font files...
Loading NimbusSanL-Regu font from /usr/share/fonts/default/Type1/n019003l.pfb... 3561652 2191972 5250028 3908193 1 done.
>>showpage, press <return> to continue<<

XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 62 requests (62 known processed) with 0 events remaining.

which shows the rectangle nicely on the screen, but nothing on the printer or in its print queue.

I am probably missing something obvious here, can anyone please help? And apologies if this has already been asked and answered somewhere.

  • 1
    gs -sOutputFlie= looks like a typo. Does -sOutputFile=... do any better? – JigglyNaga Sep 30 '16 at 15:18
  • 1
    You mention that a test page is perfect - what software are you using to do that? – JigglyNaga Sep 30 '16 at 15:20
  • Thanks for pointing out the typo, I'm often blind to them, but % gs -sOutputFile=HP_LaserJet_Professional_P_1102w GhostScript/Grid02.ps did no better. – Harry Weston Sep 30 '16 at 18:00
  • Thanks for pointing out the typo, I've corrected the original question, I'm often blind to them, but % gs -sOutputFile=HP_LaserJet_Professional_P_1102w GhostScript/Grid02.ps did no better. I got the Test page via "System Control centre" "Printers" and clicked "Print Test Page" for the HP – Harry Weston Sep 30 '16 at 18:06
  • Sorry about the similar comments, got caught out by the time limit, and can't, I think, delete one – Harry Weston Sep 30 '16 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.