Would you like to make this site your homepage? It's fast and easy...
Yes, Please make this my home page!
Printing to an HP Printer from your Sparc
Include the standard disclaimer here, Copyright Jeff Goldman 1997.
This page describes the set up for SunOS 4.1.3_U1 (and equivalent?).
Connection: Null modem cable to your favorite serial port (we'll use ttya)
Don't forget to switch the hardware pin inside the sparc2 to RS232-C
(See the installation guide here)
Printer
Settings:
- Bank A: 1up, 3up (all the rest down)
- Bank B: 2up, 5up (all the rest down)
- This sets the printer for ascii characters, 19200baud, CR only,
- No Parity, 300dpi, DTR & Xon/Xoff (consult HP manual to confer)
Ascii printing:
The entry below will print ascii on your DeskJet+. The pl#63 sets the lines
per page at 66. The default is 66 but with that setting, the printer will
print 63 lines on one page, 3 lines on the next, and then form-feeds to a
new page to continue (careful, the L's look like pipes).
/etc/printcap file:
- lp|ascii-printer|hp|HP DeskJet Plus:\
- :lp=/dev/ttya:sd=/spool_directory/hp:\
- :lf=/spool_directory/hp/errors:\
- :br#19200:sh:\
- :ms=pass8,ixon:\
- :pl#63:mx#0:
Post-Script Printing:
This is very cool (well, it is to me!). The DeskJet+ is capable of
printing postscript -- who would have thought it! It accomplishes this
through ghostscript and a filter called "apsfilter." You can find both
of these with xarchie (or on the web).
First, get ghostscript working (I used ver3.01).
make sure you tell the makefile where your X11 includes and libs are.
For me, since I was using openwin, the first time I compiled gs, I
didn't include the locations /usr/openwin/lib and /usr/openwin/include.
This can cost you because gs will still compile yet it won't find the
libraries.
Second, get the apsfilter and
modify it as follows:
- follow the directions for creating apsfilter and then put it
in /usr/local/bin
- you may need to comment out the first occurrence of "echo -ne '\033E'".
This is used for the DeskJet500.
- change all -sDEVICE from dj500 to deskjet (or your printer device)
- you may have to change the line /usr/local/.../quit.ps to the
actual location of that file. For gs3.01 it is:
/usr/local/lib/ghostscript/3.01/quit.ps
These are the modifications I made to make the apsfilter work with the HP
DeskJet+:
- 422c422
- < PRINTER=djet500
- ---
- > PRINTER=deskjet
- 515c515
- < PAPERSIZE=a4
- ---
- > PAPERSIZE=letter
- 596c596
- < ECHO="echo -e"
- ---
- > #ECHO="echo -e"
- 599c599
- < #ECHO=echo
- ---
- > ECHO=echo
- 686c686
- < $ECHO '\033&l0H\c'
- ---
- > #$ECHO '\033&l0H\c'
- 726c726
- < $ECHO '\033E\c'
- ---
- > #$ECHO '\033E\c'
Here is the /etc/printcap file:
- postscript-printer|ps|HP DeskJet Plus-Postscript:\
- :lp=/dev/ttya:sd=/spool_directory/hp:\
- :lf=/spool_directory/hp/errors:\
- :br#19200:sh:\
- :ms=pass8,ixon,-opost:\
- :sf:mx#0:\
- :if=/usr/local/bin/apsfilter:
Be sure and read the "problems" section on the previous
page. You may encounter some of the same troubles.
If you need any more help, let me know.
And, to help us all, please send me email (goldman@ucla.edu)
of your experiences using any of these
files. Thank you.
A special thanks goes out to Stefan Mueller-Pfeiffer, who helped me get things
started with the printcap entry and of course Andreas Klemm for the apsfilter.
Sincerely,
Jeffrey Goldman
goldman@ucla.edu
Home Page: http://www.cs.ucla.edu/~goldman