Tru64-FAQ-Printing
Printing 1 -- Printcap filter syntax example
Replace /usr/lbin/printfilter with the appropriate print filter. For example, if you are using a PostScript printer replace
/usr/lbin/printfilter with /usr/lbin/ps_level1of
When editing the printcap file make sure that:
- No characters, spaces or tabs exist after the line continuation character.
- Place comments between queue definitions, not in a definition. Eg:
:af=/usr/lbin/lpacct:
# Inserting comments in a definition will cause problems
:if=/usr/lbin/ln03rof:
Printing 2 -- TCP/IP Network Printing using socket connection
Requires Tru64 UNIX V4.0a or later.
lp|lp0|0:
:ct=tcp:
:af=/usr/adm/lpacct:
:if=/usr/lbin/printfilter:
:lf=/usr/adm/lp0err:
:lp=@printer_ip_name/port_9100:
:mx#0:
f=/usr/lbin/printfilter:
:pl#66:
:pw#80:
:rw:
:sd=/usr/spool/lpd0:
f=/usr/lbin/xf:
The /etc/services file must be updated to include the printer port/socket number. In this example the printer uses port 9100 so the following /etc/services entry was added.
port_9100 9100/tcp
The name port_9100 is user definable. If a 9100/tcp entry exists, use the name previously defined. Don't create a second entry. The port number is printer specific. Some printer port numbers are:
Printer Manufacture Printer Model Port / Socket
Compaq LN16 9100
LN32 9100
Digital DEClaser 3500 10001
DEClaser 5100 10001
LN15 3001
LN17 2501
LN20 35 or 6869
LN40 35 or 6869
LNC02 35 or 6869
Rapid Print 200 10001
Rapid Print 500 3001
Hewlett Packard All Printers 9100
JetDirect EX+3 9100 - port1
9101 - port2
9102 - port3
Lexmark All Printers 9100
Printing 3 -- Parallel port connection
lp|lp0|0:
:af=/usr/adm/lpacct:
:if=/usr/lbin/printfilter:
:lf=/usr/adm/lp0err:
:lp=/dev/lp0:
:mx#0:
f=/usr/lbin/printfilter:
:pl#66:
:pw#80:
:sd=/usr/spool/lpd0:
f=/usr/lbin/xf:
Note, if the setup utility added :rw:, remove it.
Printing 4 -- Serial Port connection
Serial port using software XON/XOFF data flow control at 19200 baud rate.
lp|lp0|0:
:af=/usr/adm/lpacct:
:br#19200:
:ct=dev:
:fc#0177777:
:fs#03:
:if=/usr/lbin/printfilter:
:lf=/usr/adm/lp0err:
:lp=/dev/tty00:
:mx#0:
f=/usr/lbin/printfilter:
:pl#66:
:pw#80:
:rw:
:sd=/usr/spool/lpd0:
c#0177777:
f=/usr/lbin/xf:
s#044000:
If you have stair stepping problems, or the text runs off the page, change :fs#03: to :fs#023:. This instructs the serial port driver to insert a carriage return character after a line feed.
Printing 5 -- Network lpd remote printing
lp|lp0|0:
:lf=/usr/adm/lp0err:
:lp=:
:rm=system_name:
:rp=queue_name:
:sd=/usr/spool/lpd0:
Print filters are not used, even when specified. Printing features such as banner pages, landscape printing and tray selection must be provided by the remote system.
Printing 6 -- Network printers using lpd remote connection
lp|lp0|0:
:lf=/usr/adm/lp0err:
:lp=:
:rm=printer_ip_name:
:rp=raw:
:sd=/usr/spool/lpd0:
Some printers use the rp value to specify file processing. The value is printer dependent and case sensitive. For HP LaserJet printers, use 'text' to process text files, and 'raw' for no file processing, and for all other file types including PostScript files.
Print filters are not used, even when specified. Printing features such as banner pages, landscape printing and tray selection are not available.
Printing 7 -- Print filters
This section specifies which print filter to use when lprsetup or printconfig does not include your printer model.
It's possible more than one filter will work for a printer. The following selected filters will provide basic printing capabilities and will work for all connection methods. Basic printing capabilities is the ability to print text files. Preformatted files should be printed using the -x flag, for example 'lpr -Pqueue -x file.pcl'. The -x flag instructs the print system to use the pass-through filter to prevent file formatting. The pass-through filter is usually defined in the printcap entry as f=/usr/lbin/xf:.
Some print filters, such as the lpf filter, only work on the serial port. The serial port driver provides a feature to insert a carriage return after a line feed that is not available for the parallel port, tcp/ip and lpd remote connections. Without this feature some print filters generate an output known as stair stepping. Stair stepping can look like one long line running off the page, but usually you will see the following:
LINE1
LINE2
LINE3
All print filters will work on the serial port with the correct settings. Only some filters will work for parallel port, and tcp/ip printing.
Don't expect access to mail bins, input trays, output trays, and other nice hardware features. This requires a device specific filter or special customizations.
Printing 8 -- Postscript printer filter
Printcap filter specification: /usr/lbin/ps_level1of
Lprsetup printer type: ps_level1
This filter provides text to PostScript file conversion. The filter can't convert files containing printer control codes, such as HP PCL, or process PostScript files starting with printer specific commands such as
HP PJL %-12345X.
Features:
Converts text files to PostScript.
Portrait and landscape printing.
Simplex and duplex printing.
Notes:
For A4 paper use the filter specification '/usr/lbin/ps_level1of -Sa4'.
Printing 9 -- Generic text printing
Printcap filter specification:
/usr/lbin/pcfof +Cgeneric_text.pcf
Lprsetup printer type:
generic_text
This setup is intended for all printers using letter paper, printing at 10 characters per inch and at 6 lines per inch. Refer to the printer manual for instructions on how to configure the printer.
Features:
Formats text files and eliminates stair stepping.
Odd and even page printing.
Notes:
Change printcap setting :pw#80: to :pw#0:.
For A4 paper use printer type generic_text_a4 or printer file generic_text_a4.pcf.
Printing 10 -- HP PCL printing
Printcap filter specification:
/usr/lbin/pcfof +Chpdj680c.pcf
Lprsetup printer type:
hp680c
This setup will work for impact, inkjet and laser printers that include the Hewlett Packard PCL3 through PCL5e printer programming language.
Refer to the printer manual to determine if the PCL language is provided. Many printers provide more than one language. For these printers set the default language to PCL or to auto file sensing.
Some printers that include the PCL language are HP, Lexmark, Xerox. Epson and Canon printers have their own language and probably won't include the PCL language.
Features:
- Formats text files and eliminates stair stepping.
- Portrait and landscape printing.
- Odd and even page printing.
Notes:
Change printcap setting :pw#80: to :pw#0:.
For A4 paper use printer type hp680c_a4 or print file hpdj680c_a4.pcf.
Not all printers are the same, so here are some additional filter specifications to try:
/usr/lbin/pcfof +Chpdj1120c.pcf
/usr/lbin/pcfof +Cln17.pcf
Printing 11 -- DEC ANSI printers
Printcap filter specification:
/usr/lbin/pcfof +Cgeneric_ansi.pcf
Lprsetup printer type:
generic_ansi
Features:
- Formats text files and eliminates stair stepping.
- Odd and even page printing.
Notes: Change printcap setting :pw#80: to :pw#0:.
For A4 paper use printer type generic_ansi_a4 or print file generic_ansi_a4.pcf.
Printing 12 -- Selecting print filters
You need to select a filter based on the printer language, not by the printer make and model. If you don't know what languages are provided reference the printer manual.
You looked in the manual and you still don't know which filter to select.
Try the following:
Printer Filter Type
--------------------------- -----------------
HP LaserJet PCL Filter or PostScript Filter
HP DeskJet PCL Filter
Lexmark Laser PCL Filter or PostScript Filter
Lexmark Ink Jet PCL Filter
Xerox Laser PCL Filter or PostScript Filter
Canon Generic Text Filter
Epson Generic Text Filter
All other printers Generic Text Filter
If the printer is connected to the serial port you can also try the following filters:
Printer Filter
--------------------------- -----------------
All printers /usr/lbin/lpf
Epson /usr/lbin/epsonof
These epsonof and lpf filters require a printcap setting of :fs#023:.
Printing 13 -- Printing postscript files on a non-postscript printer
Tru64 UNIX does not provide this functionality. Look into using the GhostScript freeware utility
tiantian02 回复于:2003-05-20 08:32:49 |
好东西!
但有个疑问:Some printers use the rp value to specify file processing. The value is printer dependent and case sensitive. For HP LaserJet printers, use 'text' to process text files, and 'raw' for no file processing, and for all other file types including PostScript files. 其中一个选项为text,另一个选项为raw,可以为PostScript吗? |
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/