• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

Tru64-FAQ-Printing

发布: 2007-6-08 22:43 | 作者: seanhe | 来源: | 查看: 31次 | 进入软件测试论坛讨论

领测软件测试网
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/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网