home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / HOWTO / OTHER-FO / PRINTING.INF / PRINTING / Printing-HOWTO.info-1 next >
Encoding:
GNU Info File  |  1994-02-20  |  48.5 KB  |  1,187 lines

  1. This is Info file Printing-HOWTO.info, produced by Makeinfo-1.55 from
  2. the input file printing.texinfo.
  3.  
  4.    A guide to printing and previewing files under the Linux operating
  5. system.
  6.  
  7.    Copyright (C) 1994 by Grant Taylor and Brian McCauley
  8.  
  9. 
  10. File: Printing-HOWTO.info,  Node: Top,  Next: Intro,  Prev: (dir),  Up: (dir)
  11.  
  12. * Menu:
  13.  
  14. * Intro::
  15. * Printing software::
  16. * LPR::
  17. * Previewing::
  18. * Ascii Translation::
  19. * Concept Index::
  20. * Program Index::
  21.  
  22. 
  23. File: Printing-HOWTO.info,  Node: Intro,  Next: Printing software,  Prev: Top,  Up: Top
  24.  
  25. Intro
  26. *****
  27.  
  28.    This is the Printing HOWTO for Linux.  This is a member of the second
  29. generation of Linux FAQs.  The original Linux FAQ gradually became a
  30. monolithic beast, and has now been re-written in a new syle, refering to
  31. HOWTOs for details.  This HOWTO details how to properly set up most
  32. types of printers, how to configure software to make them print well,
  33. what types of fax software are available, and how to preview many types
  34. of printable output. It was originally written by Grant Taylor
  35. <gtaylor@cs.tufts.edu> and later incorporated the lpd-FAQ by Brian
  36. McCauley <B.A.McCauley@bham.ac.uk>. Other HOWTOs detail networking,
  37. kernel hacking, etc.  All HOWTOs are found in several places, the
  38. official location being:
  39. `sunsite.unc.edu:/pub/Linux/docs/HOWTO'
  40.  
  41.    Like just about any usenet FAQs they can also be found on
  42. `rtfm.mit.edu'.
  43.  
  44.    Please send comments, bug reports, etc, to
  45. <printing@god.ext.tufts.edu>.  This address goes to both Brian and
  46. Grant.
  47.  
  48.    If you know anything or can point us towards any useful programs not
  49. in this document that should be, please let us know!
  50.  
  51.    Grant has a mail server set up on his machine.  It stores documents
  52. and other things related to printing and previewing with Linux,
  53. including the latest and greatest version of this document. At some
  54. point in the future this will probably be superceded by our own
  55. directory on one of the major ftp servers. Mail to
  56. <listserv@god.ext.tufts.edu> with a body of `info' will have you sent a
  57. list of available files.  A body of `get file1 [file2 file3... ]' will
  58. send you specific files.
  59.  
  60.    Summary of changes
  61.  
  62.    * Now in texinfo! Available from sunsite in texinfo, dvi and text
  63.      forms. The info form may be read in emacs but less you are a real
  64.      emacsphile or don't have X then you'd probably be better off using
  65.      `tkinfo'.
  66.  
  67.      `tkinfo' is available by anonymous ftp from:
  68.      `ptolemy.eecs.berkeley.edu:pub/misc'
  69.      `harbor.ecn.purdue.edu:pub/tcl/code'
  70.  
  71.      The ptolemy site will always have the latest version.
  72.  
  73.    * New mailserver info.
  74.  
  75.    * Much dead-wood removed.
  76.  
  77.    * Attributions on individual sections do not appear in the final
  78.      version although they do in the texinfo source.
  79.  
  80.    * Assorted little changes
  81.  
  82.    * Incorporated Karl Auer's <Karl.Auer@anu.edu.au> document. This is
  83.      still not seemless so you'll likely find some duplication and
  84.      missing cross references - please let us know.
  85.  
  86. 
  87. File: Printing-HOWTO.info,  Node: Printing software,  Next: LPR,  Prev: Intro,  Up: Top
  88.  
  89. Printing software
  90. *****************
  91.  
  92.    These sections describe printing software known to be available for
  93. Linux.  Note that most Un*x printing software can be easily compiled
  94. under Linux.
  95.  
  96. * Menu:
  97.  
  98. * text::
  99. * pr::
  100. * PostScript::
  101. * fonts::
  102. * faxing::
  103. * *roff::
  104. * Printing text via PostScript::
  105. * PostScript utilities::
  106. * TeX/dvi::
  107. * texinfo::
  108. * printing through a terminal::
  109. * hardware and drivers::
  110. * Printer device names::
  111.  
  112. 
  113. File: Printing-HOWTO.info,  Node: text,  Next: pr,  Prev: Printing software,  Up: Printing software
  114.  
  115. text
  116. ====
  117.  
  118.    Under Linux, or under most any Un*x operating system, the easiest
  119. thing to print with most printers is plain ASCII.  Any way you can
  120. arrange to send the text to the printer is perfectly valid.  If you
  121. have a serial printer, then try devices `/dev/ttyS?', `/dev/ttys?',
  122. `/dev/cua?', etc, and if you have a regular parallel hookup, use
  123. `/dev/lp?'.  Typing `cat FILE >/dev/????' should do it.  You may need
  124. root privileges, or you may wish to chmod your printer device if this
  125. is all you ever print.  (Note the security hole there if you've more
  126. than one user) Some printers (ie, HP DeskJet) want dos-style end of
  127. lines: newline+carriage return.  These printers will show the
  128. 'staircase effect'. *Note The staircase effect::.
  129.  
  130. 
  131. File: Printing-HOWTO.info,  Node: pr,  Next: PostScript,  Prev: text,  Up: Printing software
  132.  
  133. pr
  134. ==
  135.  
  136.    Most plain ascii files in the un*x world have a tendency to be just
  137. that - plain, unformatted ascii with no page breaks or anything else to
  138. make a printed copy look nice and not have lines printed over
  139. perferations.  The answer to this problem is to run your text through a
  140. formatter such as pr.  Pr is a standard un*x utility designed to format
  141. plain text for printing on a line printer.  The usual appearance of the
  142. resulting formatted text has a header and/or footer, page numbers, the
  143. date, possibly margins, double spacing, etc.  As is common with un*x
  144. utils, pr has a bazillion options.  They are detailed in the man page.
  145.  
  146. 
  147. File: Printing-HOWTO.info,  Node: PostScript,  Next: fonts,  Prev: pr,  Up: Printing software
  148.  
  149. PostScript
  150. ==========
  151.  
  152.    Printing almost anything other than plain text under Un*x usually
  153. involves the ability to print PostScript.  If you have a PostScript
  154. printer, you're all set.  But for most, this is not so easy.
  155.  
  156.    The established way to interpret PostScript under Linux is to use
  157. ghostscript, which, like nearly everything else, comes from the GNU
  158. project.  Ghostscript is a PostScript interpreter which accepts
  159. PostScript input and generates output appropriate for X displays, most
  160. printers, some specialized display hardware, and fax software.
  161.  
  162.    The following devices are available as of ghostscript 2.6.1pl4:
  163.              linux   PC vga using linux svgalib
  164.      #       x11     X Windows version 11, release >=4   [Unix and VMS only]
  165.      # Printers:
  166.      # *     appledmp  Apple Dot Matrix Printer (Imagewriter)
  167.      #       bj10e   Canon BubbleJet BJ10e
  168.      # *     bj200   Canon BubbleJet BJ200
  169.      # *     cdeskjet  H-P DeskJet 500C with 1 bit/pixel color
  170.      # *     cdjcolor  H-P DeskJet 500C with 24 bit/pixel color and
  171.      #               high-quality color (Floyd-Steinberg) dithering
  172.      # *     cdjmono  H-P DeskJet 500C printing black only
  173.      # *     cdj500  H-P DeskJet 500C (same as cdjcolor)
  174.      # *     cdj550  H-P DeskJet 550C
  175.      # *     declj250  alternate DEC LJ250 driver
  176.      # +     deskjet  H-P DeskJet and DeskJet Plus
  177.      # *     dfaxhigh  DigiBoard, Inc.'s DigiFAX software format
  178.      # *     dfaxlow  DigiFAX low (normal) resolution
  179.      #       djet500  H-P DeskJet 500
  180.      # *     djet500c  H-P DeskJet 500C
  181.      #       epson   Epson-compatible dot matrix printers (9- or 24-pin)
  182.      # +     eps9high  Epson-compatible 9-pin, interleaved lines
  183.      #               (triple resolution)
  184.      # *     epsonc  Epson LQ-2550 and Fujitsu 3400/2400/1200 color printers
  185.      # *     escp2   Epson ESC/P 2 language printers, including Stylus 800
  186.      # +     ibmpro  IBM 9-pin Proprinter
  187.      # *     jetp3852  IBM Jetprinter ink-jet color printer (Model #3852)
  188.      # +     laserjet  H-P LaserJet
  189.      # *     la50    DEC LA50 printer
  190.      # *     la75    DEC LA75 printer
  191.      # *     lbp8    Canon LBP-8II laser printer
  192.      # *     ln03    DEC LN03 printer
  193.      # *     lj250   DEC LJ250 Companion color printer
  194.      # +     ljet2p  H-P LaserJet IId/IIp/III* with TIFF compression
  195.      # +     ljet3   H-P LaserJet III* with Delta Row compression
  196.      # +     ljet4   H-P LaserJet 4 (defaults to 600 dpi)
  197.      # +     ljetplus  H-P LaserJet Plus
  198.      # *     m8510   C.Itoh M8510 printer
  199.      # *     necp6   NEC P6/P6+/P60 printers at 360 x 360 DPI resolution
  200.      # *     nwp533  Sony Microsystems NWP533 laser printer   [Sony only]
  201.      # *     oki182  Okidata MicroLine 182
  202.      #       paintjet  H-P PaintJet color printer
  203.      # *     pj      alternate PaintJet XL driver
  204.      # *     pjxl    H-P PaintJet XL color printer
  205.      # *     pjxl300  H-P PaintJet XL300 color printer
  206.      # *     r4081   Ricoh 4081 laser printer
  207.      # *     sparc   SPARCprinter
  208.      # *     t4693d2  Tektronix 4693d color printer, 2 bits per R/G/B component
  209.      # *     t4693d4  Tektronix 4693d color printer, 4 bits per R/G/B component
  210.      # *     t4693d8  Tektronix 4693d color printer, 8 bits per R/G/B component
  211.      # *     tek4696  Tektronix 4695/4696 inkjet plotter
  212.      #%*     trufax  TruFax facsimile driver  [Unix only]
  213.      # File formats and others:
  214.      #       bit     A plain "bit bucket" device
  215.      #       bmpmono Monochrome MS Windows .BMP file format
  216.      #       bmp16   4-bit (EGA/VGA) .BMP file format
  217.      #       bmp256  8-bit (256-color) .BMP file format
  218.      #       bmp16m  24-bit .BMP file format
  219.      #       gifmono Monochrome GIF file format
  220.      #       gif8    8-bit color GIF file format
  221.      #       pcxmono Monochrome PCX file format
  222.      #       pcxgray 8-bit gray scale PCX file format
  223.      #       pcx16   Older color PCX file format (EGA/VGA, 16-color)
  224.      #       pcx256  Newer color PCX file format (256-color)
  225.      #       pbm     Portable Bitmap (plain format)
  226.      #       pbmraw  Portable Bitmap (raw format)
  227.      #       pgm     Portable Graymap (plain format)
  228.      #       pgmraw  Portable Graymap (raw format)
  229.      #       ppm     Portable Pixmap (plain format)
  230.      #       ppmraw  Portable Pixmap (raw format)
  231.      # *     tiffg3  TIFF/F (G3 fax)
  232.  
  233.    Lines beginning with a `#' are drivers included with the gs261
  234. source distribution.
  235.  
  236.    Drivers marked with `%' require commercial software to work
  237.  
  238.    Installations of ghostscript are available from several places:
  239.  
  240.    A full, and presumably correct, installation comes with most
  241. distributions.  Note that this binary installation may require
  242. `libX.so.???', as it includes the X11 display driver.
  243.  
  244.    The "official" installation is to obtain the sources and build it
  245. yourself:
  246.  
  247.    `prep.ai.mit.edu:/pub/gnu/ghostscript-xxxx.tar.gz'
  248. `prep.ai.mit.edu:/pub/gnu/ghostscript-fonts-xxxx.tar.gz'
  249.  
  250.    This is probably best, as you can get the latest version (currently
  251. 2.6.1pl4 (the four patches are separate, they are available from my
  252. mail-server as `gs261-patches')).
  253.  
  254.    A patch which uses the Linux svgalib, and hence does not require X
  255. for previewing is available. *Note non-X previewing::.
  256.  
  257.    A minimal binary installation of ghostscript and several other
  258. packages needed for printing the Linux documentation is available as:
  259. `sunsite.unc.edu:/pub/Linux/apps/tex/texmin/texmin-0.1.tar.z'.
  260.  
  261.    Note that this does not contain any PostScript fonts.  (Nor do you
  262. need them to print dvi (aka [La]TeX).)
  263.  
  264.    The main Ghostscript documentation is contained in the file
  265. `use.doc', either in the source directory, or
  266. `lib/ghostscript/doc/use.doc' if you haven't the sources.
  267.  
  268.    To print ps, first determine your driver name with `gs -help' which
  269. lists installed drivers.  If the device you need is not listed, you
  270. must compile gs yourself from the source distribution (do not panic.
  271. Do follow the instructions in make.doc.  You will need 5 or 6 megs of
  272. space to build it in.)  Then type `gs -dNOPAUSE -sDEVICE=??????
  273. -sOutputFile=/dev/???? file.ps' and your output should (hopefully)
  274. appear at your printer.  Those of you with non-US paper sizes may wish
  275. to build gs yourself with the right default, or you may use the
  276. `-sPAPERSIZE=a4' option.
  277.  
  278.    Ghostscript may be used to print at most of the resolutions your
  279. printer supports; `-r300', `-r150', `-r360x180' are examples of the
  280. option used to control this.  Dot matrix printers in particular need to
  281. choose an appropriate resolution, since they do not typically run at
  282. the more standard 300dpi.  Note that versions 2.6 and greater of
  283. ghostscript have more drivers.
  284.  
  285. 
  286. File: Printing-HOWTO.info,  Node: fonts,  Next: faxing,  Prev: PostScript,  Up: Printing software
  287.  
  288. fonts
  289. =====
  290.  
  291.    (This section contains font information not specific to any
  292. ghostscript driver, nor even specific to ghostscript).  Font
  293. information pertaining to the X11 `gs' drivers (and thus to ghostview)
  294. is included in the ghostview section under previewing)
  295.  
  296.    All versions of ghostscript come with assorted public-domain fonts,
  297. most of which were generated from bitmaps, and are therefore of
  298. relatively poor quality.  However, ghostscript can use any PostScript
  299. Type 1 or 3 fonts you may have handy.  For example, the Adobe Type
  300. Manager (for any platform other than mac) comes with fonts you can use.
  301. Place the fonts (typically *.pc?) in `lib/ghostscript/fonts/' and add
  302. to `lib/ghostscript/Fontmap' lines such as:
  303.  
  304.      /Courier             (com_____.pfb) ;
  305.  
  306.    A full fontmap file for the ususal set of fonts included with the
  307. Adobe Type Manager is available as `fontmap.atm' from the printing
  308. mailserver.
  309.  
  310.    TimesNewRomanPS and ArialMT fonts are interchangable with Times Roman
  311. and Helvetica, so you can alias them this way if this is what you have.
  312.  
  313.    Adobe Type 1 fonts may be found on the net in several places:
  314. `ftp.cica.indiana.edu:/pub/pc/win3/fonts'
  315. `archive.umich.edu:/msdos/mswindows/fonts'
  316.  
  317.    I have not looked in these places, but this information is lifted
  318. straight from the comp.fonts FAQ (which you should read if fonts are a
  319. thing for you.  You can get a copy of this from `rtfm.mit.edu').
  320.  
  321.    Conversion between various font types is tricky.  Ghostscript comes
  322. with the tools needed to take a bitmap (hopefully large) and make a
  323. scalable ps font.  Groff comes with the tools to allow use of tfm/mf
  324. (TeX) and pfb (Type 1) fonts in *roff documents.  X11R5 includes
  325. several font utilities and Type 1 rendering code contributed by IBM.  I
  326. have used none of the above, but they all come with manpages, so read
  327. them.  Other font conversion utilities are listed in the comp.fonts
  328. FAQ.  Also look into the package fontutils on
  329. `prep.ai.mit.edu:/pub/gnu/'.
  330.  
  331. 
  332. File: Printing-HOWTO.info,  Node: faxing,  Next: *roff,  Prev: fonts,  Up: Printing software
  333.  
  334. faxing
  335. ======
  336.  
  337.    If you have a fax modem, you can arrage to fax things out (and in),
  338. including PostScript, dvi, ascii, etc...  Arranging for e-mail to fax
  339. itself somewhere is also straightforward.
  340.  
  341.    Fax modems support one of of two cammand sets: Class 1 or 2.  Class
  342. one modems are have less of what goes on in a fax supported in firmware
  343. (thus the software has to do more.  Supporting such timing-critical
  344. things under a preemptive multitasking environment like Linux is tricky
  345. at best).  The class 1 standard is EIA 578.  Class 2 modems tend to be
  346. more expensive and comply with the standard EIA 592.  Mention of your
  347. fax modem's level of support should be in its manuals.  Do not confuse
  348. class and group.  You will, of course, want a group III fax modem.
  349.  
  350.    Fax software which runs under Linux must convert input in whatever
  351. format into a Group III compatible image format for transmission.  As
  352. usual, Ghostscript does the job.  The device tiffg3 generates standard
  353. g3/tiff encoded fax messages.  You must compile this device in if it is
  354. not there already; this is yet another reason to get the source.  Some
  355. fax sofware on commercial platforms can use the display PostScript
  356. renderer to render the fax image; this is not yet an option under Linux.
  357.  
  358.    The GNU program netfax supports Class 2 fax modems only.  It builds
  359. nearly out of the box under linux.  I have patches for version 3.2.1;
  360. you can get them from the printing mail server as `netfaxpatch'.  It
  361. runs a server and accepts jobs into a queue from the local machine and
  362. the net.  Netfax is in use at MIT.  It accepts PostScript, dvi, and
  363. ascii, and can be configured to work as an email gate.  Documentation
  364. in the package is limited to compile notes and man pages for the
  365. individual programs; actual installation tips are few and far between.
  366. `prep.ai.mit.edu:/pub/gnu/fax-3.2.1.tar.gz'
  367.  
  368.    FlexFax is available from:
  369. `sgi.com(192.48.153.1):/sgi/fax/?????.src.tar.Z'
  370.  
  371.    It is written in C++, and thus requires g++ to build.  FlexFax
  372. supports class 1 and 2 modems, uses ghostview (or a display PostScript
  373. server) for rendering, and generally is more complete, or at least
  374. general than the somewhat MIT-specific netfax.  It also can run in
  375. place of getty and either receive a fax or spawn a login as appropriate
  376. for the type of call.  It includes precise instructions on configuring
  377. smail3, sendmail, and other mail agents to send mail for
  378. so-and-so@12345678.fax to the fax at 12345678.  This is the package I
  379. recommend if you have real faxing needs, as it is properly documented
  380. and full-featured.  Version 2.x of FlexFax is in real release now and
  381. fully supports Linux - just type `./configure' and `make'.
  382.  
  383.    mgetty+sendfax is a Linux and SCO-specific getty for faxmodems and a
  384. simple sendfax program.  This package is available as
  385. `sunsite.unc.edu:/pub/Linux/system/Serial/mgetty+sendfax-0.16.tar.gz'.
  386. This is a good package for those who need to send a fax every now and
  387. then.
  388.  
  389.    Finally, `efax' deserves mention.  Class 2 only.  no net, no mail,
  390. just send a tiff.  Efax is available as:
  391. `sunsite.unc.edu:/pub/Linux/apps/comm/efax05.tar.gz'
  392.  
  393. 
  394. File: Printing-HOWTO.info,  Node: *roff,  Next: Printing text via PostScript,  Prev: faxing,  Up: Printing software
  395.  
  396. *roff, man pages
  397. ================
  398.  
  399.    Man pages can sometimes be printed straight from the cat pages (in
  400. lieu of the normal nroff source pages) as though they were a normal
  401. text file (which they mostly are).  However, many printers do not like
  402. the control characters for highlighting and what not that is imbedded
  403. in these.  A filter for this purpose comes with the net-2 lpd package.
  404.  
  405.    If you have the nroff source to the page (the finding of which I
  406. highly recommend) you can say `man -t foobar | lpr' and your man
  407. program will (hopefully) format the man page using groff into
  408. PostScript, which will then be sent to your lpd and on to the printer.
  409. This form of man page output looks MUCH better than the plain ASCII
  410. version.  Unfortunately, this depends very much on which man program
  411. and what supporting software you have installed.  If your man doesn't
  412. do this, you might try the perl version of man, available near:
  413. `sunsite.unc.edu:/pub/Linux/system/Manual-pagers/'
  414.  
  415.    It is written entirely in perl, and is thus easily customizable (perl
  416. being an interpreted language reminiscent of C and sh).
  417.  
  418.    You can also find the nroff source file in the man directories (most
  419. versions of man have an option to just spit out the filename) and do it
  420. yourself, into any format supported by groff.
  421.      groff -mandoc -TTYPE foobar.1 | lpr
  422.  
  423.    Where TYPE is one of `ascii', `dvi', `ps', `X100', `X75', `latin8'.
  424.  
  425. 
  426. File: Printing-HOWTO.info,  Node: Printing text via PostScript,  Next: PostScript utilities,  Prev: *roff,  Up: Printing software
  427.  
  428. Printing text via PostScript
  429. ============================
  430.  
  431.    There are a number of utilities to allow text to be printed to a
  432. PostScript device.
  433.  
  434. * Menu:
  435.  
  436. * mpage::
  437. * a2ps::
  438. * enscript::
  439. * gslp::
  440.  
  441. 
  442. File: Printing-HOWTO.info,  Node: mpage,  Next: a2ps,  Prev: Printing text via PostScript,  Up: Printing text via PostScript
  443.  
  444. mpage
  445. -----
  446.  
  447.    The package mpage converts plain text into PostScript and/or prints
  448. more than one page onto each peice of paper given PostScript or text.
  449. It is available at (or at least near):
  450. `wuarchive.wustl.edu:/pub/mirrors/unix-c/PostScript/mpage.tar-z'
  451.  
  452.    Note that wuarchive uses the `-z' suffix to mean `.Z', ie,
  453. `compress', not `gzip' or `freeze'. `man -t foobar | mpage' will send a
  454. 2-up (depending on the environment variable MPAGE) version of the man
  455. page to lpr and its PostScript interpreter.  This saves paper and
  456. speeds up printing.
  457.  
  458. 
  459. File: Printing-HOWTO.info,  Node: a2ps,  Next: enscript,  Prev: mpage,  Up: Printing text via PostScript
  460.  
  461. a2ps
  462. ----
  463.  
  464.    A2ps will take ASCII and turn it into a nice PostScript document with
  465. headers and footers and page numbers, printed two pages on one (or
  466. otherwise, if you say so).  A2ps does a very nice job at this.  It is
  467. available at the same place mpage is.  Not that if you have a deskjet,
  468. many n-up programs will run into trouble by trying to print in that last
  469. half-inch.
  470.  
  471. 
  472. File: Printing-HOWTO.info,  Node: enscript,  Next: gslp,  Prev: a2ps,  Up: Printing text via PostScript
  473.  
  474. enscript
  475. --------
  476.  
  477.    Enscript is a program which does basically the same thing as a2ps.  I
  478. do not know where to get it.  It comes with most commercial Un*ces.
  479.  
  480.    A clone version of enscript is called nenscript, available on
  481. `sunsite.unc.edu' as:
  482. `/pub/Linux/system/Printing/nenscript-1.13++.bin.tar.z'
  483. `/pub/Linux/system/Printing/nenscript-1.13++.tar.z'
  484.  
  485. 
  486. File: Printing-HOWTO.info,  Node: gslp,  Prev: enscript,  Up: Printing text via PostScript
  487.  
  488. gslp
  489. ----
  490.  
  491.    Gslp is one of the uilities which comes with ghostscript 2.6.x and
  492. purports to do the same ascii => ps conversion as enscript and a2ps.  I
  493. have not used it, but the docs say that
  494.  
  495.      gs -q -sDEVICE=????? -dNOPAUSE -- gslp.ps TEXT.FILE [OPTIONS]
  496.  
  497.    should do the trick.  (`gslp.ps' is the actual program, which is
  498. written in PostScript.  Here it is run with the argument TEXT.FILE.
  499. PostScript is in many respects a programming language more than a mere
  500. printer command language.)  Further documentation is in the file
  501. `gslp.ps'.  There is a script file which does the above for you.
  502.  
  503. 
  504. File: Printing-HOWTO.info,  Node: PostScript utilities,  Next: TeX/dvi,  Prev: Printing text via PostScript,  Up: Printing software
  505.  
  506. PostScript utilities
  507. ====================
  508.  
  509.    Those of you who deal with large amounts of PostScript may wish for
  510. more utility programs.  There are probably millions of little programs
  511. which do things to your PostScript. A representative package of them
  512. may be found in:
  513. `achilles.doc.ic.ac.uk:/tex/inter/psutils/'
  514. `ftp.cs.psu.edu:/pub/src/psutil.tar.gz'
  515.  
  516.    These handle page selection, double-sided printing, booklet creation,
  517. etc.  Most large ftp sites (eg, `wuarchive.wustl.edu', `ftp.uu.uunet')
  518. will have many such packages to choose from.
  519.  
  520. 
  521. File: Printing-HOWTO.info,  Node: TeX/dvi,  Next: texinfo,  Prev: PostScript utilities,  Up: Printing software
  522.  
  523. TeX/dvi
  524. =======
  525.  
  526.    [La]TeX is the text formatting package used by many in the academic
  527. world and elsewhere.  TeX works much like any other compiler - source
  528. code is run through the program `tex' to become a `.dvi' file
  529. (analogous to an .o object file in C) which can be further manipulated
  530. to produce printed output (a "binary").  This manipulation of a dvi
  531. (DeVice Independant) file usually takes a little bit of doing.  It is
  532. well worth it; TeX's output is of professional quality.
  533.  
  534.    If all you are given is a file with a `.tex' ending, try either `tex
  535. file.tex' or `latex file.tex'.  One of these is bound to work.  Then
  536. you have a dvi.  (You may have to run it twice for indexing)
  537.  
  538.    For those in the real world who cannot afford a dvi understanding
  539. printer, it is usually necessary to convert the dvi something the
  540. printer understands. These programs may be run manualy but are often
  541. built into lpd filters. *Note Writing lpd filters::.
  542.  
  543. * Menu:
  544.  
  545. * dvips::
  546. * eps::
  547. * dvilj::
  548.  
  549. 
  550. File: Printing-HOWTO.info,  Node: dvips,  Next: eps,  Prev: TeX/dvi,  Up: TeX/dvi
  551.  
  552. `dvips'
  553. -------
  554.  
  555.    `dvips' converts dvi into PostScript that you can pipe into
  556. ghostscript or send to a PostScript printer.  Most installations come
  557. with functioning installations of both TeX and `dvips'.  Typing `dvips
  558. -f1 file.dvi | lpr' will do it.  `dvips' responds to either command line
  559. arguments or a file `/usr/TeX/lib/tex/ps/config.ps' (in the usual TeX
  560. layout, at least) in which you can arrange to have dvips automatically
  561. send its output to `lpr'.  Thus `dvips file.dvi' will do everything
  562. that needs to be done.
  563.  
  564.    Note that some `.dvi''s may include PostScript graphics in the
  565. `dvips' stage rather than the TeX stage of the game; if they are not
  566. found, you will get a hole instead of a picture.  This follows
  567. naturally from the object file analogy above.  Usually, pre-made
  568. documentation in this form has a makefile or script to do everything for
  569. you.  The LILO documentation is an example of this.
  570.  
  571.    `dvips' has several interesting options; for example, `dvips -r1
  572. file.dvi' will print it out backwards.  We deskjet users love this one.
  573.  
  574. 
  575. File: Printing-HOWTO.info,  Node: eps,  Next: dvilj,  Prev: dvips,  Up: TeX/dvi
  576.  
  577. `eps'
  578. -----
  579.  
  580.    Eps is a program which converts dvi files directly into the standard
  581. Epson printer language; thus it is a dvi driver for epsons.  I beleive
  582. it supports MakeTeXPK, the automatic font rendering system used by many
  583. dvi drivers, and is available as:
  584. `sunsite.unc.edu:/pub/Linux/apps/tex/eps-061.tar.gz'
  585. `ftp.ctd.comsat.com:/pub/'
  586.  
  587.    Note that it is still coming out with new versions fairly often, so
  588. there may be a newer version than 061.
  589.  
  590. 
  591. File: Printing-HOWTO.info,  Node: dvilj,  Prev: eps,  Up: TeX/dvi
  592.  
  593. `dvilj'
  594. -------
  595.  
  596.    For LaserJet owners, there is a separate program that will take dvi
  597. and convert it directly into your printer's language (PCL).  It is
  598. called dvilj2p or dvilj, and if not on tsx or sunsite, is certainly
  599. available on ftp.uu.net.
  600.  
  601.    (Description by Nils Rennebarth)
  602.  
  603.      Its a nice driver, but a little out of fashion in the sense that
  604.      configuration (especially of font-paths) font-paths is not very
  605.      flexible and that it doesn't support virtual fonts (at least the
  606.      version 0.51 not).  The biggest advantage over the
  607.      dvips/ghostscript combo is that it uses downloadable fonts which:
  608.         * reduces data transmission to the printer drastically, which
  609.           makes the printer usable even on a serial line.
  610.  
  611.         * reduces printer-memory-requirements drastically. A standard
  612.           Laserjet with 512k memory is able to print almost every
  613.           TeX-document.
  614.  
  615.      It has support for double side printing and most options you
  616.      expect a driver to have. It compiles cleanly and worked flawlessly
  617.      on our diverse hardware here.
  618.  
  619. 
  620. File: Printing-HOWTO.info,  Node: texinfo,  Next: printing through a terminal,  Prev: TeX/dvi,  Up: Printing software
  621.  
  622. texinfo
  623. =======
  624.  
  625.    This is the native documentation format of the GNU project.  Emacs
  626. can be coerced into producing an info file from TeXinfo, and TeX can
  627. produce nice printed documantation from the same file.  It is a bit of
  628. a stretch for both systems, but it works.  It is really just TeX source
  629. which expects the macro file `texinfo.tex' to be installed on your
  630. system.  Just do `tex FILENAME' twice (for index generation purposes),
  631. and you end up with a plain dvi file, to print or preview at your
  632. leisure.
  633.  
  634.    In Emacs, you can also do `M-x texinfo-format-buffer' to convert the
  635. texinfo file into an info file viewable with Emacs `M-x info' or an info
  636. viewer of your choice.
  637.  
  638.    There are also separate programs which read and format info from a
  639. texinfo file.  These are available in:
  640. `prep.ai.mit.edu:/pub/gnu/'
  641.  
  642. 
  643. File: Printing-HOWTO.info,  Node: printing through a terminal,  Next: hardware and drivers,  Prev: texinfo,  Up: Printing software
  644.  
  645. Printing though a terminal
  646. ==========================
  647.  
  648.    Many terminals and terminal emulators support the connection of a
  649. printer.  The computer the terminal is conected to may then use a
  650. standard set of escape sequences to operate this printer.  DEC VT's and
  651. most other ANSI terminals should offer this capability.
  652.  
  653.    A simple shell script will enable you to print a text file using the
  654. printer connected to your terminal:
  655.  
  656.      #!/bin/csh -f
  657.      # Transparent printing on a vt100-compatible terminal.
  658.      echo -n \[5i ; cat $* ; echo -n \[4i
  659.  
  660.    If this script is called `vtprint', then `vtprint [FILENAME
  661. [FILENAME]]' will print file(s) (or stdin if no file were specified) on
  662. your printer.
  663.  
  664. 
  665. File: Printing-HOWTO.info,  Node: hardware and drivers,  Next: Printer device names,  Prev: printing through a terminal,  Up: Printing software
  666.  
  667. hardware and drivers
  668. ====================
  669.  
  670.    There are two ways the kernel driver may be used to run the parallel
  671. ports.  One, the original, is the polling driver.  The other is the
  672. interrupt driver.  In principle, the interrupt driver only deals with
  673. the port when it gets an interrupt and should therefore be more
  674. efficient.  In practice, people have found that it depends on the
  675. machine.  It probably doesn't make too much difference in most
  676. situations.
  677.  
  678.    For the polling driver, you may adjust its polling frequency with the
  679. program tunelp without kernel twiddling. The actual driver is in the
  680. kernel source file `lp.c'.
  681.  
  682.    To choose the interrupt driver rather than the polled, use the
  683. program tunelp to set it.  (tunelp is available on sunsite, or from the
  684. printing mail server.)  Just put the appropriate line in `/etc/rc.local'
  685.  
  686.    Seven is the usual "LPT1:" IRQ, 5 is usual for "LPT2:" for an AT
  687. class machine.  Note that if your printer is on lp0, the interrupt
  688. driver will probably not work.  The first parameter should already
  689. contain the correct i/o base address.  Many bios boot screens have this
  690. information if you need it.
  691.  
  692.    DOS uses a polling driver so if you find that your printer works in
  693. DOS but not in Linux then you should try the polling driver.
  694.  
  695.    `tunelp' is available from the printing mail server or:
  696. `sunsite.unc.edu:/pub/Linux/system/Printing/tunelp-1.0.tar.z'
  697.  
  698. 
  699. File: Printing-HOWTO.info,  Node: Printer device names,  Prev: hardware and drivers,  Up: Printing software
  700.  
  701. Printer device names
  702. ====================
  703.  
  704.    On an XT bus system `LPT1:' becomes `/dev/lp0' (major=6, minor=0),
  705. on an AT `LPT1:' becomes `/dev/lp1' (major=6, minor=1). To be more
  706. precise:
  707.  
  708.      Name Major Minor I/O address
  709.       lp0   6     0       0x3bc
  710.       lp1   6     1       0x378
  711.       lp2   6     2       0x278
  712.  
  713.    For a serial printer use the `/dev/ttyS?' (or `/devttys?', if you
  714. follow that scheme) device, not the `/dev/cua?'  device. The
  715. `/dev/ttyS?' devices have major 4; the `/dev/cua?' devices have major 5.
  716.  
  717. 
  718. File: Printing-HOWTO.info,  Node: LPR,  Next: Previewing,  Prev: Printing software,  Up: Top
  719.  
  720. LPR
  721. ***
  722.  
  723.    This chapter used to the the `lpd-FAQ' then it became part of the
  724. `Linux-FAQ' and now it is part of the Printing-HOWTO. Who knows where
  725. it will go next?
  726.  
  727. * Menu:
  728.  
  729. * Setting up print services::
  730. * What lpr & lpd do::
  731. * Getting hold of lpd::
  732. * lpd files and permissions::
  733. * lpd not working::
  734. * Where Do I Get A Printcap For Printer Model xxxxx?::
  735. * The Semantics of /etc/printcap::
  736. * The Syntax of /etc/printcap::
  737. * An /etc/printcap gotcha::
  738. * The Minimum /etc/printcap::
  739. * The staircase effect::
  740. * Resetting The Printer After Each Printout::
  741. * Preventing FF each file::
  742. * lpd via serial port::
  743. * serial port cop out::
  744. * Printers not in /dev::
  745. * Burst/banner pages::
  746. * Spooling text to a PS printer::
  747. * Trunation of graphics files::
  748. * Why lpr -i does not work::
  749. * Why lpr -p does not work::
  750. * "no daemon present"::
  751. * lpr over a network::
  752. * Writing lpd filters::
  753. * Debuging filters::
  754. * Output filters::
  755. * Filters for given printers::
  756. * Programs that do not read STDIN::
  757. * Many filters::
  758. * Magic Filters::
  759. * Magic Filter Examples::
  760.  
  761. 
  762. File: Printing-HOWTO.info,  Node: Setting up print services,  Next: What lpr & lpd do,  Prev: LPR,  Up: LPR
  763.  
  764. Setting up print services
  765. =========================
  766.  
  767.    This section was originally writen Karl Auer <Karl.Auer@anu.oedu.au>
  768. 1/11/93 and has now been included here because it was felt that the
  769. Printing-HOWTO, being written in the style of a reference manual, was
  770. not doing its job properly, since it did not describe in a
  771. straightforward way what you need to do to set up print services on your
  772. Linux machine.
  773.  
  774.    So far it has been included with little modification and may
  775. replicate or even contradict information elsewhere in the HOWTO.  The
  776. overview it gives should nevertheless be very useful to those new to
  777. bsd print spooling.
  778.  
  779. * Menu:
  780.  
  781. * Remote Printing Vs. Local Printing::
  782. * What You Need::
  783. * How Printing Works Under Linux::
  784. * The important programs::
  785. * The lpr command::
  786. * The lpq command::
  787. * The lprm command::
  788. * The lpc command::
  789. * The important directories::
  790. * The important files::
  791. * More about /etc/printcap::
  792. * Fields in /etc/printcap::
  793. * More On The lp Field::
  794. * More on the lf field::
  795. * More on the if field::
  796. * More on the rm and rp fields::
  797. * More on the sh and sf fields::
  798. * More on the mx field::
  799. * A test printcap entry::
  800. * Putting It All Together::
  801. * More On Remote Printing::
  802. * The Fiddly Bits::
  803. * Troubleshooting::
  804.  
  805. 
  806. File: Printing-HOWTO.info,  Node: Remote Printing Vs. Local Printing,  Next: What You Need,  Prev: Setting up print services,  Up: Setting up print services
  807.  
  808. Remote Printing Vs. Local Printing
  809. ----------------------------------
  810.  
  811.    Remote printing is allowing people to send print jobs to your
  812. computer from another computer. This will be needed if, for example,
  813. you are running as a server in a network, or if a printer attached to
  814. your machine is to be accessible from other Unix hosts.
  815.  
  816.    Local printing is allowing users on your machine to send print jobs
  817. to a printer attached to your machine.
  818.  
  819.    There is a third combination too - your own use of remote printing
  820. on other Unix machines. That is, where you wish to print on a printer
  821. that is not attached to your own computer.
  822.  
  823. 
  824. File: Printing-HOWTO.info,  Node: What You Need,  Next: How Printing Works Under Linux,  Prev: Remote Printing Vs. Local Printing,  Up: Setting up print services
  825.  
  826. What You Need
  827. -------------
  828.  
  829.    This document assumes you know how to edit a text file under Linux,
  830. and that you have a basic understanding of file ownership and
  831. permissions.
  832.  
  833.    It also assumes that you have your Linux system set up and running
  834. correctly.  In particular, if you are going to use remote printing your
  835. networking subsystems must be installed and operating correctly.
  836.  
  837.    Check out the man pages on the commands `chmod' and `chown' for more
  838. information.
  839.  
  840. 
  841. File: Printing-HOWTO.info,  Node: How Printing Works Under Linux,  Next: The important programs,  Prev: What You Need,  Up: Setting up print services
  842.  
  843. How Printing Works Under Linux
  844. ------------------------------
  845.  
  846.    The simplest way to print under Unix (and thus under Linux) is to
  847. send the print data directly to the printer device. This command will
  848. send a directory listing to the first parallel printer (LPT1: in DOS
  849. terms):
  850.  
  851.      ls > /dev/lp0
  852.  
  853.    This method does not take advantage of the multitasking capabilities
  854. of Linux, because the time taken for this command to finish will be
  855. however long it takes the printer to actually physically print the
  856. data. On a slow printer, or a printer which is deselected or
  857. disconnected, this could be a long time.
  858.  
  859.    A better method is to spool the data. That is, to collect the print
  860. data into a file, then start up a background process to send the data
  861. to the printer.
  862.  
  863.    This is essentially how Linux works. For each printer, a spool area
  864. is defined.  Data for the printer is collected in the spool area, one
  865. file per print job.  A background process (called the printer daemon)
  866. constantly scans the spool areas for new files to print. When one
  867. appears, the data is sent to the appropriate printer or *despooled*.
  868. When more than one file is waiting to be printed, they will be printed
  869. in the order they were completed - first in, first out. Thus the spool
  870. area is effectively a queue, and the waiting jobs are often referred to
  871. as being "in the print queue", or "queued".
  872.  
  873.    In the case of remote printing, the data is first spooled locally as
  874. for any other print job, but the background process is told to send the
  875. data to a particular printer on a particular remote machine.
  876.  
  877.    The necessary information that the printer daemon needs to do its
  878. job - the physical device to use, the spool area to look in, the remote
  879. machine and printer for remote printing and so on - is all stored in a
  880. file called `/etc/printcap'. The details of this file are discussed
  881. below.
  882.  
  883.    In the discussions that follow, the term "printer" will be used to
  884. mean a printer as specified in `/etc/printcap'. The term "physical
  885. printer" will be used to mean the thing that actually puts characters on
  886. paper. It is possible to have multiple entries in `/etc/printcap' which
  887. all describe one physical printer, but do so in different ways. If this
  888. is not clear to you, read the section on `/etc/printcap'.
  889.  
  890. 
  891. File: Printing-HOWTO.info,  Node: The important programs,  Next: The lpr command,  Prev: How Printing Works Under Linux,  Up: Setting up print services
  892.  
  893. The important programs
  894. ----------------------
  895.  
  896.    There are five programs which comprise the Unix print system. They
  897. should be in the locations shown, should all be owned by root and
  898. belong to the group daemon and have the permissions shown here:
  899.  
  900.          -rwsr-sr-x    /usr/bin/lpr
  901.          -rwsr-sr-x    /usr/bin/lpq
  902.          -rwsr-sr-x    /usr/bin/lpc
  903.          -rwsr-sr-x    /usr/bin/lprm
  904.          -rwxr-s---    /etc/lpd
  905.  
  906.    The first four are used to submit, cancel and inspect print jobs.
  907. `/etc/lpd' is the printer daemon.
  908.  
  909.    (The locations, ownerships and permissions given here are a
  910. simplification and may be wrong for your system *note lpd files and
  911. permissions::.)
  912.  
  913.    There are man pages for all these commands, which you should consult
  914. for more information. The important points are that by default `lpr',
  915. `lprm', `lpc' and `lpq' will operate on a printer called `lp'. If you
  916. define an environment variable called `PRINTER', the name thus defined
  917. will be used instead. Both these may be overridden by specifying the
  918. printer name to use on the command line thus:
  919.  
  920.      lpc -PMYPRINTER
  921.  
  922. 
  923. File: Printing-HOWTO.info,  Node: The lpr command,  Next: The lpq command,  Prev: The important programs,  Up: Setting up print services
  924.  
  925. The `lpr' Command
  926. -----------------
  927.  
  928.    The `lpr' command submits a job to the printer, or "queues a print
  929. job". What actually happens is that the file you specify is copied to
  930. the spool directory (see above), where it will be found by `lpd', which
  931. then takes care of moving the data to the physical printer. If you don't
  932. specify a file, `lpr' uses standard input.
  933.  
  934. 
  935. File: Printing-HOWTO.info,  Node: The lpq command,  Next: The lprm command,  Prev: The lpr command,  Up: Setting up print services
  936.  
  937. The `lpq' Command
  938. -----------------
  939.  
  940.    The `lpq' command shows you the contents of the spool directory for
  941. a given printer. One important piece of information displayed by `lpq'
  942. is the job id, which identifies a particular job. This number must be
  943. specified if you wish to cancel a pending job.
  944.  
  945.    `lpq' also shows a rank for each job in the queue - "active" means
  946. the file is actually printing (or at least that `lpd' is trying to
  947. print it). Otherwise a number shows you where in the queue the job is.
  948.  
  949. 
  950. File: Printing-HOWTO.info,  Node: The lprm command,  Next: The lpc command,  Prev: The lpq command,  Up: Setting up print services
  951.  
  952. The `lprm' Command
  953. ------------------
  954.  
  955.    The `lprm' command removes a job from the queue - that is, it
  956. removes unprinted files from the spool directory. You can either specify
  957. a job id (obtained by using the `lpq' command) or specify `-' as the
  958. job id, in which case all jobs belonging to you will be cancelled. If
  959. you do this as root, all jobs for the printer will be cancelled. If you
  960. are root and want to remove all the jobs belonging to a specific user,
  961. specify the user's name.
  962.  
  963. 
  964. File: Printing-HOWTO.info,  Node: The lpc command,  Next: The important directories,  Prev: The lprm command,  Up: Setting up print services
  965.  
  966. The `lpc' Command
  967. -----------------
  968.  
  969.    The `lpc' command lets you check the status of printers and control
  970. some aspects of their use. In particular it lets you start and stop
  971. despooling on printers, lets you enable or disable printers and lets you
  972. rearrange the order of jobs in a print queue. The following commands
  973. disable printing on myprinter, enable the spool queue on yourprinter and
  974. move job number 37 to the top of the queue:
  975.  
  976.      lpc down myprinter
  977.      lpc enable yourprinter
  978.      lpc topq 37
  979.  
  980.    If invoked without any command arguments, lpc will be interactive,
  981. prompting you for actions to take. Read the man page for complete
  982. instructions. Bear in mind that some `lpc' functions are restricted to
  983. root.
  984.  
  985. 
  986. File: Printing-HOWTO.info,  Node: The important directories,  Next: The important files,  Prev: The lpc command,  Up: Setting up print services
  987.  
  988. The Important Directories
  989. -------------------------
  990.  
  991.    There is really only one important directory - the spool area where
  992. data to be printed is accumulated before `/etc/lpd' prints it. However,
  993. typically a system will be set up with multiple spool directories, one
  994. for each printer. This makes printer management easier. My system is set
  995. up to use `/usr/spool/lpd' as the main spool area, with each separate
  996. printer having a directory under that with the same name as the
  997. printer. Thus I have a printer called `ps_nff' which has
  998. `/usr/spool/lpd/ps_nff' as its spool directory and so on.
  999.  
  1000.    The spool directories should belong to the daemon group and be user
  1001. and group read/writable, and world -readable. That is, after creating
  1002. the directory make sure it has permissions "-rwxrwxr-x" (0775). For the
  1003. directory myprinter, the appropriate command would be:
  1004.  
  1005.      chmod ug=rwx,o=rx myprinter
  1006.      chgrp daemon myprinter
  1007.  
  1008.    (The locations, ownerships and permissions given here are a
  1009. simplification and may be wrong for your system *note lpd files and
  1010. permissions::.)
  1011.  
  1012. 
  1013. File: Printing-HOWTO.info,  Node: The important files,  Next: More about /etc/printcap,  Prev: The important directories,  Up: Setting up print services
  1014.  
  1015. The Important Files
  1016. -------------------
  1017.  
  1018.    Apart from the programs discussed above, each spool directory should
  1019. contain four files - `.seq', `errs'. `lock' and `status'. These files
  1020. should have the permissions "-rw-rw-r-". The `.seq' file contains the
  1021. job number counter for `lpr' to assign a and the `status' file contains
  1022. the message to be reported by `lpc stat'. The `lock' file is used by
  1023. `lpd' to prevent itself trying to print two jobs to the same printer at
  1024. once, and the `errs' file is a log of printer failures.
  1025.  
  1026.    The file `errs' is not required and can actually be called whatever
  1027. you like - the name is specified in `/etc/printcap', but the file must
  1028. exist for `lpd' to be able to log to it, so it is usually created
  1029. manually when setting up the spool area. More on this later.
  1030.  
  1031.    One very important file is the file `/etc/printcap', which is
  1032. described in detail in the following sections.
  1033.  
  1034. 
  1035. File: Printing-HOWTO.info,  Node: More about /etc/printcap,  Next: Fields in /etc/printcap,  Prev: The important files,  Up: Setting up print services
  1036.  
  1037. More About /etc/printcap
  1038. ------------------------
  1039.  
  1040.    The file `/etc/printcap' is a text file, which may be edited with
  1041. your favourite editor. It should be owned by root and have the
  1042. permissions "-rw-r-r-".
  1043.  
  1044.    The contents of `/etc/printcap' are typically very cryptic-looking,
  1045. but once you know how it works they are much easier to understand. The
  1046. problem is compounded by the fact that in some braindead distributions
  1047. there is no man page for printcap, and the fact that most printcaps are
  1048. created either by programs or by people with no thought for
  1049. readability. For your own sanity, I recommend making the layout of your
  1050. printcap file as logical and readable as possible, with lots of
  1051. comments. And get the a man page from the lpd sources, if you don't
  1052. already have it.
  1053.  
  1054.    One printcap entry describes one printer. Essentially a printcap
  1055. entry provides a logical name for a physical device, then describes how
  1056. data to be sent to that device is to be handled. For example, a printcap
  1057. entry will define what physical device is to be used, what spool
  1058. directory data for that device should be stored in, what preprocessing
  1059. should be performed on the data, where errors on the physical device
  1060. should be logged and so forth. You can limit the amount of data which
  1061. may be sent in a single job, or limit access to a printer to certain
  1062. classes of user.
  1063.  
  1064.    It is perfectly OK to have multiple printcap entries defining several
  1065. different ways to handle data destined for the same physical printer.
  1066. For example, a physical printer may support both PostScript and HP
  1067. Laserjet data formats, depending on some setup sequence being sent to
  1068. the physical printer before each job. It would make sense to define two
  1069. printers, one of which preprocesses the data by prepending the HP
  1070. LaserJet sequence while the other prepends the PostScript sequence.
  1071. Programs which generate HP data would send it to the HP printer, while
  1072. programs generating PostScript would print to the PostScript printer.
  1073.  
  1074.    Programs which change the data before it is sent to the physical
  1075. printer are called "filters".  It is possible for a filter to send no
  1076. data at all to a physical printer.
  1077.  
  1078.    *Note The Syntax of /etc/printcap::
  1079.  
  1080.      # Sample printcap entry with two aliases
  1081.      myprinter|laserwriter:\
  1082.          # lp is the device to print to - here the first parallel printer.
  1083.          :lp=/dev/lp0: \
  1084.          # sd means 'spool directory' - where print data is collected
  1085.          :sd=/usr/spool/lpd/myprinter:
  1086.  
  1087. 
  1088. File: Printing-HOWTO.info,  Node: Fields in /etc/printcap,  Next: More On The lp Field,  Prev: More about /etc/printcap,  Up: Setting up print services
  1089.  
  1090. Fields in `/etc/printcap'
  1091. -------------------------
  1092.  
  1093.    There are too many fields to describe here in full, so I'll just
  1094. describe the most important ones. All fields in `/etc/printcap' (except
  1095. for the names of the printer) are enclosed between a pair of colons and
  1096. are denoted by a two-letter code. The two-letter code is followed by a
  1097. value that depends on the type of field. There are three types of field
  1098. - string, boolean and numeric *Note The Syntax of /etc/printcap::.
  1099.  
  1100.    The following fields are the most common and most important ones:
  1101.  
  1102.      lp      string          specify the device to print to, eg /dev/lp0
  1103.      sd      string          specify the name of the spool directory for
  1104.                              this printer
  1105.      lf      string          specify the file to which errors on this
  1106.                              printer are to be logged
  1107.      if      string          specify the input filter name
  1108.      rm      string          specify the name of a remote printing host
  1109.      rp      string          specify the name of a remote printer
  1110.      sh      boolean         specify this to suppress headers (banner pages)
  1111.      sf      boolean         specify this to suppress end-of-job form feeds
  1112.      mx      numeric         specify the maximum allowable print job size
  1113.                              (in blocks)
  1114.  
  1115. 
  1116. File: Printing-HOWTO.info,  Node: More On The lp Field,  Next: More on the lf field,  Prev: Fields in /etc/printcap,  Up: Setting up print services
  1117.  
  1118. More on The `lp' Field
  1119. ----------------------
  1120.  
  1121.    If you specify `/dev/null' as the print device, all other processing
  1122. will be performed correctly, but the final data will go to the bit
  1123. bucket. This is rarely useful except for test printer configurations or
  1124. with weird printers *Note Printers not in /dev::. When you are setting
  1125. up a remote printer (that is, you have specified `rm' and `rp' fields),
  1126. you should specify `:lp=:'.
  1127.  
  1128.    Don't leave the field empty unless you are using a remote printer.
  1129. The printer daemon will complain if you don't specify a print device.
  1130.  
  1131. 
  1132. File: Printing-HOWTO.info,  Node: More on the lf field,  Next: More on the if field,  Prev: More On The lp Field,  Up: Setting up print services
  1133.  
  1134. More On The lf Field
  1135. --------------------
  1136.  
  1137.    Whatever file you specify should already exist, or logging will not
  1138. occur.
  1139.  
  1140. 
  1141. File: Printing-HOWTO.info,  Node: More on the if field,  Next: More on the rm and rp fields,  Prev: More on the lf field,  Up: Setting up print services
  1142.  
  1143. More On The if Field
  1144. --------------------
  1145.  
  1146.    Input filters are programs which take print data on their standard
  1147. input and generate output on their standard output. A typical use of an
  1148. input filter is to detect plain text and convert it into PostScript.
  1149. That is, raw text is its input, PostScript is its output. *Note Writing
  1150. lpd filters::.
  1151.  
  1152.    When you specify an input filter, the printer daemon does *not* send
  1153. the spooled print data to the specified device. Instead, it runs the
  1154. input filter with the spooled data as standard input and the print
  1155. device as standard output. (For another use for input filters *note A
  1156. test printcap entry::.).
  1157.  
  1158. 
  1159. File: Printing-HOWTO.info,  Node: More on the rm and rp fields,  Next: More on the sh and sf fields,  Prev: More on the if field,  Up: Setting up print services
  1160.  
  1161. More On The `rm' and `rp' Fields
  1162. --------------------------------
  1163.  
  1164.    Sending your print data to a printer attached to another machine is
  1165. as simple as specifying the remote machine `rm' and the remote printer
  1166. `rp', and making sure that the print device field `lp' is empty. Note
  1167. that data will still be spooled locally before being transferred to the
  1168. remote machine, and any input filters you specify will be run also.
  1169.  
  1170. 
  1171. File: Printing-HOWTO.info,  Node: More on the sh and sf fields,  Next: More on the mx field,  Prev: More on the rm and rp fields,  Up: Setting up print services
  1172.  
  1173. More On The `sh' and `sf' Fields
  1174. --------------------------------
  1175.  
  1176.    Unless you have a lot of different people using your printer, you
  1177. will most likely not be interested in banner pages.
  1178.  
  1179.    Suppressing form feeds is most useful if your printer is typically
  1180. used for output from wordprocessing packages. Most WP packages create
  1181. complete pages of data, so if the printer daemon is adding a form feed
  1182. to the end of each job, you will get a blank page after each job. If the
  1183. printer is usually used for program or directory listings, however,
  1184. having that form feed ensures that the final page is completely ejected,
  1185. so each listing starts at the top of a new page.
  1186.  
  1187.