More question HPLaser and MAPGEM
PoKung Lin
pklin at CERF.NET
Fri Sep 9 12:02:50 EDT 1994
Jill,
Thank you for the information of setting up the connection between
HPLaserJet 4M and GRASS-MAPGEN4.1 interface. I have followed your instructions,
by first adding a line "laser ps /dev/tty00" to the etc/PLOTTER file and
then trying command "plotter -d ps ovm/* | lp -dlaser". As the result, this
printing job was sent to printer. However, after printed out the cover page,
the job was stopped (I mean there has no any real data been printed). So I
suspect there may be a problem in the output file generated by program
"plotter". As you explaned to me before, "plotter -d ps ovm/*" part of the
command should generate a postscript file and then put it through printer
spooler. The text between "========" line is the file "test" generated by
the command "plotter -d ps ovm/* > test". It seems has no postscripted map
data in it at all (since I don't know postscript commands I can not say
surely). I did try several times. Each times with more map layers added in.
But the result file were only a few lines more then the one that was shown
below. I am wondering if you may create a similiar output file with a very
simple line data and sent to me. Because I really thing there are some problems
within plotter program code ( I got it from CERL ftp imcoming directory).
=====================================================
devname=ps.
%!PS
/L { {rlineto} repeat currentpoint stroke moveto} bind def
/U { moveto } bind def
1 setlinecap
1 setlinejoin
gsave
.14226378 .14226378 scale
1 setlinewidth
0 5588 translate
-90 rotate
5 setlinewidth 0.000 setgray
1 setlinewidth 0.000 setgray
5 setlinewidth 0.000 setgray
0 0 U 5588 0 1 L
0 4318 U 0 -4318 1 L
1 setlinewidth 0.000 setgray
grestore
showpage
===========================================================
What is this "showpage" command means? It seems try to start include
some real data but they are not showing up, is't right?
The other problem that should be no direct connection with the above
one, which is the problem in plot.sh file. Remember, if we type command
"plot.sh ovm/*", program will prompt us for printer name, then for paper size.
If I supply the paper size with answer "a", or any other legal answer, the
plot.sh program will give me a error massage, something like
========================================================
AVAILABLE MAPGEN plotters (PRINTER_NAME hpgl cps laser )
Enter the plotter name from the list: laser
Enter the paper size:
a= 8.5 x 11
b= 11 x 17
c= 17 x 22
d= 22 x 34
e= 34 x 44
f= non standard paper
SIZE:a
invalid/uninstalled device selected
plotter failure, Ver.4.6
device initialization failure: psa
request id is laser-753 (standard input)
=================================================
I checked plot.sh file and find out the following portion of the
code.
=================================================
plotter=` grep $printer $GRAPH/etc/PLOTTER | awk 'NR == 1 {print $2}'`
if test "$size" = "f"; then
ttydev=`grep ${printer} $GRAPH/etc/PLOTTER | awk 'NR == 1 {print $3}'`
##### PK Lin question: This will cause runtime error. Why do it this way?
plotter -d ${plotter}a $* > $ttydev < $ttydev &
else
##### PK Lin question: This will cause runtime error. Why do it this way?
plotter=$plotter$size
plotter -d $plotter $* | lp -d $printer"
fi
cd $CDIR
=================================================
I don't understand why should we pass two different parameters
$plotter and $size as a single string to program "plotter"? Is this a bug?
But if it's a bug, which part of the C code that really take care this
"paper size" problem?
Thank you in advance.
PK Lin
Tel: (617) 942-1655
E-mail: pklin at cerf.net
P.S. My printer support postscript language without any doult.
For example, I can simply print out mapgen/PROJ.4.1.3.ps by typing
"lp PROJ.4.1.3.ps" at unix prompt.
More information about the grass-dev
mailing list