| 1 |
Installation of ppa-0.8.5 with S.u.S.E. Linux |
| 2 |
(Special Installation with Hp820 and paper size A4) |
| 3 |
___________________________________________________ |
| 4 |
|
| 5 |
|
| 6 |
0. Introduction |
| 7 |
|
| 8 |
This text describes how to use the package pbm2ppa written by Tim Norman |
| 9 |
with the S.u.S.E Linux System. This program allows the use of GDI (Winows |
| 10 |
only) printers with Linux. The program pbm2ppa is actually a converter |
| 11 |
between the two formats pbm (an output format from ghostscript) and the |
| 12 |
format understood by the HP printers 720, 820 and 1000. So anyway we have to |
| 13 |
use ghostscript to produce pbm (or faster: pbmraw) files. To print ascii |
| 14 |
files there is an extra step invoking enscript to convert the ascii to |
| 15 |
postscript files. I rather constructed two new printer spoolers in printcap |
| 16 |
from scratch then using apsfilter: one for postscript files and another for |
| 17 |
ascii files. I welcome solutions in combination with the apsfilter script. |
| 18 |
The installation is quiet easy - after seven steps you should be ready to |
| 19 |
print postscript and ascii files, but it may take some time to adjust the |
| 20 |
constants properly, don't despair. |
| 21 |
|
| 22 |
0.1. Modifications |
| 23 |
|
| 24 |
This was modified on October 18, 1998 by Tim Norman to conform to the new |
| 25 |
A4 paper support in version 0.8.5. |
| 26 |
|
| 27 |
|
| 28 |
1. Installation of program package ppa-0.8.5 |
| 29 |
|
| 30 |
Get the packate at http://www.rpi.edu/~normat/technical/ppa/ and compile it |
| 31 |
with |
| 32 |
|
| 33 |
# make 820 |
| 34 |
|
| 35 |
or put in your printer number (720, 820 or 1000) (see also INSTALL and README |
| 36 |
file). |
| 37 |
|
| 38 |
|
| 39 |
2. To adjust the paper size to DIN A4, use the -s a4 option to pbm2ppa or |
| 40 |
change your pbm2ppa.conf file to read "papersize a4" (see step 5). |
| 41 |
|
| 42 |
|
| 43 |
3. You can now calibrate the printer with |
| 44 |
|
| 45 |
For US size paper: |
| 46 |
# pbmtpg | pbm2ppa > /dev/lp1 ( as root ) |
| 47 |
For A4 size paper: |
| 48 |
# pbmtpg -a4 | pbm2ppa -s a4 > /dev/lp1 ( as root ) |
| 49 |
|
| 50 |
or you try first printing some sample files and calibrate in step 5. |
| 51 |
|
| 52 |
|
| 53 |
4. Now you can print (postscript) files with a shell script like this: |
| 54 |
|
| 55 |
Contents of print: |
| 56 |
|
| 57 |
cat $1 | gs -sDEVICE=pbmraw -q -dNOPAUSE -r600 -sOutputFile=- - | \ |
| 58 |
pbm2ppa - - >/dev/lp1 |
| 59 |
|
| 60 |
After changing the file modes (i.e. chmod 755 print) you are able to print |
| 61 |
a postscript file invoking the shell script print like: |
| 62 |
|
| 63 |
# print filename.ps |
| 64 |
|
| 65 |
|
| 66 |
To print ascii files just extend the script print with the use of enscript: |
| 67 |
|
| 68 |
Contents of printascii: |
| 69 |
|
| 70 |
enscript -2rj -p- $1 | \ |
| 71 |
gs -sDEVICE=pbmraw -q -dNOPAUSE -r600 -sOutputFile=- - | \ |
| 72 |
pbm2ppa - - >/dev/lp1 |
| 73 |
|
| 74 |
|
| 75 |
Check the manpage for enscript to adjust the options to your flavour. |
| 76 |
Now you can also print ascii files with |
| 77 |
|
| 78 |
# printascii filename.ascii |
| 79 |
|
| 80 |
|
| 81 |
5. It may be possible that you have to recalibrate your printer (see 3.) |
| 82 |
|
| 83 |
Here follow the results from my calibration after printing ascii files with the |
| 84 |
shell script printascii (see 4.). The program pbm2ppa takes the arguments in the |
| 85 |
following order: |
| 86 |
|
| 87 |
1. shell arguments |
| 88 |
2. config file /etc/pbm2ppa.conf |
| 89 |
3. Compiled options from default.h |
| 90 |
|
| 91 |
So whenever you invoke pbm2ppa without arguments the program uses the options |
| 92 |
stored in the file /etc/pbm2ppa.conf, so I suggest to leave there a copy of |
| 93 |
this file. |
| 94 |
|
| 95 |
# Sample configuration file for the HP820 and DIN A4 paper size |
| 96 |
# |
| 97 |
# This file will be automatically read upon startup if it's placed in |
| 98 |
# /etc/pbm2ppa.conf |
| 99 |
# |
| 100 |
|
| 101 |
version 820 |
| 102 |
|
| 103 |
papersize a4 |
| 104 |
|
| 105 |
xoff 0 # \ Adjust these for your printer. |
| 106 |
yoff -600 # / (see CALIBRATE) |
| 107 |
|
| 108 |
# 1/4 inch margins all around (at 600 DPI) |
| 109 |
top 50 |
| 110 |
bottom 50 |
| 111 |
left 50 |
| 112 |
right 50 |
| 113 |
|
| 114 |
|
| 115 |
6. To integrate the converter into the Linux system we create two printer |
| 116 |
spooler in /etc/printcap. One to print postscript files and another to print |
| 117 |
plain ascii files. |
| 118 |
|
| 119 |
Contents of /etc/printcap: |
| 120 |
|
| 121 |
lp:\ |
| 122 |
:lp=/dev/lp1:\ |
| 123 |
:sd=/var/spool/lpd/lp:\ |
| 124 |
:lf=/var/spool/lpd/lp/log:\ |
| 125 |
:af=/var/spool/lpd/lp/acct:\ |
| 126 |
:if=/usr/local/bin/ps.if:\ |
| 127 |
:la:mx#0:\ |
| 128 |
:sh:sf: |
| 129 |
|
| 130 |
ascii:\ |
| 131 |
:lp=/dev/lp1:\ |
| 132 |
:sd=/var/spool/lpd/ascii:\ |
| 133 |
:lf=/var/spool/lpd/ascii/log:\ |
| 134 |
:af=/var/spool/lpd/ascii/acct:\ |
| 135 |
:if=/usr/local/bin/ascii.if:\ |
| 136 |
:la:mx#0:\ |
| 137 |
:sh:sf: |
| 138 |
|
| 139 |
|
| 140 |
Here follow some explanations (for more information consult the printcap |
| 141 |
manpage). We use the lp1 device, have two spool directories |
| 142 |
/var/spool/lpd/ascii and /var/spool/lpd/lp (better you create them now) a log |
| 143 |
file (lf) an accounting file (af), suppress form feeds (sf), suppress printing |
| 144 |
of burst page header (sh) and the maximum file size is unlimited (mx#0). To |
| 145 |
integrate the converter pbm2ppa into the system we use two input filters. Maybe |
| 146 |
you have a better solution in combination with apsfilter but until then try |
| 147 |
this way. Actually, the two input filter files are almost identical with the |
| 148 |
shell scripts print and printascii we created in step 4. |
| 149 |
|
| 150 |
File /usr/local/bin/ascii.if: |
| 151 |
|
| 152 |
#! /bin/sh |
| 153 |
enscript -2rj -p- | \ |
| 154 |
gs -sDEVICE=pbmraw -q -dNOPAUSE -r600 -sOutputFile=- - | \ |
| 155 |
/usr/local/bin/pbm2ppa - - |
| 156 |
|
| 157 |
|
| 158 |
File /usr/local/bin/ps.if: |
| 159 |
|
| 160 |
#! /bin/sh |
| 161 |
gs -sDEVICE=pbmraw -q -dNOPAUSE -r600 -sOutputFile=- - | \ |
| 162 |
/usr/local/bin/pbm2ppa - - |
| 163 |
|
| 164 |
|
| 165 |
7. Place pbm2ppa in the directory /usr/local/bin. Now you are ready to print |
| 166 |
files with |
| 167 |
|
| 168 |
# lpr filename.ps |
| 169 |
|
| 170 |
and |
| 171 |
|
| 172 |
# lpr -P ascii filename.ascii |
| 173 |
|
| 174 |
like you are used to it. |
| 175 |
|
| 176 |
Enjoy |
| 177 |
|
| 178 |
|
| 179 |
19. May 1998 |
| 180 |
|
| 181 |
Michael Buehlmann |
| 182 |
Badenerstrasse 285 |
| 183 |
8003 Zuerich |
| 184 |
Switzerland |
| 185 |
|
| 186 |
[email protected] |
| 187 |
|