home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / misc / linhowto.zip / PRINTING.HOW < prev    next >
Text File  |  1993-10-08  |  90KB  |  2,185 lines

  1. Newsgroups: comp.os.linux.announce,comp.os.linux.admin
  2. From: gtaylor@cs.tufts.edu (Grant Taylor)
  3. Subject: Linux Printing HOWTO
  4. Keywords: Linux, printing, lpr
  5. Summary: HOWTO on printing under Linux
  6. Followup-To: poster
  7. Approved: linux-announce@tc.cornell.edu (Matt Welsh)
  8.  
  9. Archive-name: linux/howto/printing
  10. Last-Modified: 28 August 1993
  11.  
  12. Linux Printing HOWTO
  13. By Grant Taylor <gtaylor@cs.tufts.edu> 
  14. and Brian McCauley <B.A.McCauley@bham.ac.uk>
  15. ------------------------------------------------------------------------------
  16.  
  17. This is the Printing HOWTO for Linux.  This is a member of the second
  18. generation of Linux FAQS.  The original Linux FAQ gradually became a
  19. monolithic beast, and has now been re-written in a new syle, refering
  20. to HOWTOs for details.  This HOWTO details how to properly set up most
  21. types of printers, how to configure the software to make them print
  22. well, what types of fax software are available, and how to preview
  23. many types of printable output.  Other HOWTOs detail networking,
  24. kernel hacking, etc.  All HOWTOs are found in several places, the
  25. official location being sunsite.unc.edu:/pub/Linux/HOWTO, and another
  26. being rtfm.mit.edu.
  27.  
  28. Topics:
  29.          INTRO
  30.          Summary of changes since release aug 05-93
  31.          PRINTING SOFTWARE   <<<<<<<-----------
  32.          ascii
  33.          pr
  34.          postscript
  35.          fonts
  36.          faxing
  37.          *roff/man pages
  38.          mpage
  39.          a2ps
  40.          enscript
  41.          gslp
  42.          psutils
  43.          tex/dvi
  44.          dvilj
  45.          texinfo
  46.          hardware and kernel drivers
  47.      Printer device names
  48.          LPR                <<<<<<------------
  49.          What lpr and lpd do 
  50.          Where do the files go and what should their permissions be?
  51.          What are all these diretories for?
  52.          lpd not working
  53.          Where do I get a printcap for a xxxxx?
  54.          The semantics of /etc/printcap
  55.          The syntax  of a /etc/printcap
  56.          An /etc/printcap gotcha.
  57.          The minimum /etc/printcap?
  58.          How do I prevent the `staircase effect'?
  59.          Resetting the printer after each printout
  60.          Preventing formfeed after each printout
  61.          Printing to a serial port
  62.          Serial settings in printcap
  63.          cat works to the serial port, but not lpd (1)
  64.          cat works to the serial port, but not lpd (2)
  65.          Printers that aren't simple character devices
  66.          Getting burst/banner pages
  67.          Printing text on a PS printer
  68.          Trunation of graphics files
  69.          Why doesn't `lpr -i' work?
  70.          Why doesn't `lpr -p' work?
  71.          lprm says `too many users'
  72.          lpc complains that it hasn't stopped a daemon
  73.          lpr over a network
  74.          Writing lpd filters
  75.          A filter tests OK but fails when lpd uses it
  76.          `of' filters.
  77.          Getting filters for given printers
  78.          Filters from programs that won't read STDIN
  79.          Having many filters
  80.          What are magic filters?
  81.          Magic filter examples
  82.          PREVIEWING          <<<<<<------------
  83.          ghostview
  84.          gspreview
  85.          xdvi
  86.          xtex
  87.          gxditview
  88.          non-x-previewing
  89.          ASCII TRANSLATION   <<<<<<------------
  90.          from TeX
  91.          from dvi
  92.          from ps
  93.          from troff
  94.          from ascii
  95.          CONTRIBUTORS        <<<<<<------------
  96.  
  97. --------------------------------------------------------------------
  98.  
  99. Subject: INTRO
  100. From: gtaylor@cs.tufts.edu
  101.  
  102. This is the Print-HOWTO for Linux.  Please send comments, bug reports,
  103. etc, to:
  104.  
  105. gtaylor@cs.tufts.edu  (Grant Taylor) or
  106. B.A.McCauley@bham.ac.uk (Brian McCauley)
  107.  
  108. release Sep 12-93
  109.  
  110. This is a joint effort; originally, we both produced separate
  111. documents - the lpd-HOWTO, and the printing.how-to, but now we have
  112. joined forces.  The old lpd-HOWTO, which has been independent and a part
  113. of the main Linux HOWTO, now makes up the LPR section of this document.
  114. No non-digest version of either the printing.how-to or the lpd-HOWTO is
  115. current (although most of the information is correct).
  116.  
  117. If you undigestify this document with your mail reader, you can simply
  118. hit reply, and the reply will go to the maintainer of each section.
  119.  
  120. If you know anything or can point me towards any useful programs not
  121. in this document that should be, please let me know!
  122.  
  123. I have a mail server set up on my machine.  It stores documents and
  124. other things related to printing and previewing with Linux, including
  125. the latest and greatest version of this document.  Send mail with the
  126. subject `help' to:
  127.  
  128. mail-server@god.hounix.org
  129.  
  130. for further information.  (This address only valid until Spetember.)
  131. The new address will be announced when it works.
  132.  
  133. ------------------------------
  134.  
  135. Subject: Summary of changes since release aug 18-93
  136. From: gtaylor@cs.tufts.edu
  137.   
  138. now a HOWTO        -  we have joined forces with mdw and now fit
  139.                into the greater scheme of things as a part
  140.                of the FAQ/HOWTO project.
  141.  
  142. Many small corrections...
  143.  
  144. Important notice!!  The ftp site (and whole domain of)
  145. export.lcs.mit.edu will be changing it's name, and eventually number,
  146. to ftp.x.org.  This is a result of the separation of the X Consortium
  147. from the MIT Computer Science lab.  This change becomes officially
  148. effective August 18 (my birthday!), but both names will work already
  149. and for a while to come.
  150.  
  151. ------------------------------
  152.  
  153. Subject: PRINTING SOFTWARE   <<<<<<<-----------
  154. From: gtaylor@cs.tufts.edu
  155.  
  156. These sections describe printing software known to be available for
  157. Linux.  Note that most Un*x printing software can be easily ported to
  158. Linux.
  159.  
  160. ------------------------------
  161.  
  162. Subject: text
  163. From: gtaylor@cs.tufts.edu
  164.  
  165. Under Linux, or under most any Un*x operating system, the easiest
  166. thing to print with most printers is plain ASCII.  Any way you can
  167. arrange to send the text to the printer is perfectly valid.  If you
  168. have a serial printer, then try devices /dev/ttys?, /dev/ttyS?,
  169. /dev/cua?, etc, and if you have a regular parallel hookup, use
  170. /dev/lp?.  typing
  171.  
  172. cat file >/dev/????
  173.  
  174. should do it.  You may need root privileges, or you may wish to chmod
  175. your printer device if this is all you ever print.  (Note security
  176. hole there if you've more than one user)  Some printers (ie, HP
  177. DeskJet) want dos-style end of lines: newline+carriage return.
  178. These printers will show the 'staircase effect'; further information
  179. on how to deal with it is in the section "How do I prevent the
  180. staircase effect."
  181.  
  182. ------------------------------
  183.  
  184. Subject: pr
  185. From: gtaylor@cs.tufts.edu
  186.  
  187. Most plain ascii files in the unix world have a tendency to be just
  188. that - plain, unformatted ascii with no page breaks or anything else
  189. to make a printed copy look nice and not have lines printed over
  190. perferations.  The answer to this problem is to run your text through a
  191. formatter such as pr.  Pr is a standard unix utility designed to
  192. format plain text for printing on a line printer.  The usual
  193. appearance of the resulting formatted text has a header and/or footer,
  194. page numbers, the date, possibly margins, double spacing, etc.  As is
  195. common with unix utils, pr has a bazillion options.  They are detailed
  196. in the man page (which you should read), but a few useful ones are:
  197.  
  198.        -d     Double space the output.
  199.  
  200.        -e[in-tab-char[in-tab-width]]
  201.               Expand  tabs to spaces on input.  Optional argument
  202.               in-tab-char is the  input tab  character,  default
  203.               tab.   Optional  argument in-tab-width is the input
  204.               tab character's width, default 8.
  205.  
  206.        -h header
  207.               Replace  the filename in the header with the string
  208.               header.
  209.  
  210.        -l page-length
  211.               Set  the  page  length  to  page-length lines.  The
  212.               default is 66.  If page-length is less than 10, the
  213.               headers  and  footers  are  omitted,  as  if the -t
  214.               option had been given.
  215.  
  216.        -n[number-separator[digits]]
  217.               Precede each column with a line number; with paral-
  218.               lel  files,  precede  each line with a line number.
  219.               Optional argument number-separator is the character
  220.               to  print after each number, default tab. Optional
  221.               argument digits is the number of  digits  per  line
  222.               number, default 5.
  223.  
  224.        -o left-margin
  225.               Offset  each  line with a margin left-margin spaces
  226.               wide.  The total page width is this offset plus the
  227.               width set with the -w option.
  228.  
  229.        -w page-width
  230.               Set the page  width  to  page-width  columns.   The
  231.               default is 72.
  232.  
  233. ------------------------------
  234.  
  235. Subject: postscript
  236. From: gtaylor@cs.tufts.edu
  237.  
  238. Printing almost anything other than plain text under unix involves
  239. the ability to print postscript.  If you have a postscript printer,
  240. you're all set.  But for most, this is not so easy.
  241.  
  242. The established way to interpret postscript under Linux is to use
  243. ghostscript, which, like nearly everything else, comes from the GNU
  244. project.  Ghostscript is a postscript interpreter which accepts
  245. postscript input and generates output appropriate for X displays, most
  246. printers, some specialized display hardware, and fax software.  
  247.  
  248. The following devices are available as of ghostscript 2.6.1pl4:
  249.  
  250.         linux   PC vga using linux vgalib
  251. #       x11     X Windows version 11, release >=4   [Unix and VMS only]
  252. # Printers:
  253. # *     appledmp  Apple Dot Matrix Printer (should also work with Imagewriter)
  254. #       bj10e   Canon BubbleJet BJ10e
  255. # *     bj200   Canon BubbleJet BJ200
  256. # *     cdeskjet  H-P DeskJet 500C with 1 bit/pixel color
  257. # *     cdjcolor  H-P DeskJet 500C with 24 bit/pixel color and
  258. #               high-quality color (Floyd-Steinberg) dithering
  259. # *     cdjmono  H-P DeskJet 500C printing black only
  260. # *     cdj500  H-P DeskJet 500C (same as cdjcolor)
  261. # *     cdj550  H-P DeskJet 550C
  262. # *     declj250  alternate DEC LJ250 driver
  263. # +     deskjet  H-P DeskJet and DeskJet Plus
  264. # *     dfaxhigh  DigiBoard, Inc.'s DigiFAX software format (high resolution)
  265. # *     dfaxlow  DigiFAX low (normal) resolution
  266. #       djet500  H-P DeskJet 500
  267. # *     djet500c  H-P DeskJet 500C
  268. #       epson   Epson-compatible dot matrix printers (9- or 24-pin)
  269. # +     eps9high  Epson-compatible 9-pin, interleaved lines
  270. #               (triple resolution)
  271. # *     epsonc  Epson LQ-2550 and Fujitsu 3400/2400/1200 color printers
  272. # *     escp2   Epson ESC/P 2 language printers, including Stylus 800
  273. # +     ibmpro  IBM 9-pin Proprinter
  274. # *     jetp3852  IBM Jetprinter ink-jet color printer (Model #3852)
  275. # +     laserjet  H-P LaserJet
  276. # *     la50    DEC LA50 printer
  277. # *     la75    DEC LA75 printer
  278. # *     lbp8    Canon LBP-8II laser printer
  279. # *     ln03    DEC LN03 printer
  280. # *     lj250   DEC LJ250 Companion color printer
  281. # +     ljet2p  H-P LaserJet IId/IIp/III* with TIFF compression
  282. # +     ljet3   H-P LaserJet III* with Delta Row compression
  283. # +     ljet4   H-P LaserJet 4 (defaults to 600 dpi)
  284. # +     ljetplus  H-P LaserJet Plus
  285. # *     m8510   C.Itoh M8510 printer
  286. # *     necp6   NEC P6/P6+/P60 printers at 360 x 360 DPI resolution
  287. # *     nwp533  Sony Microsystems NWP533 laser printer   [Sony only]
  288. # *     oki182  Okidata MicroLine 182
  289. #       paintjet  H-P PaintJet color printer
  290. # *     pj      alternate PaintJet XL driver 
  291. # *     pjxl    H-P PaintJet XL color printer
  292. # *     pjxl300  H-P PaintJet XL300 color printer
  293. # *     r4081   Ricoh 4081 laser printer
  294. # *     sparc   SPARCprinter
  295. # *     t4693d2  Tektronix 4693d color printer, 2 bits per R/G/B component
  296. # *     t4693d4  Tektronix 4693d color printer, 4 bits per R/G/B component
  297. # *     t4693d8  Tektronix 4693d color printer, 8 bits per R/G/B component
  298. # *     tek4696  Tektronix 4695/4696 inkjet plotter
  299. #%*     trufax  TruFax facsimile driver  [Unix only]
  300. # File formats and others:
  301. #       bit     A plain "bit bucket" device
  302. #       bmpmono Monochrome MS Windows .BMP file format
  303. #       bmp16   4-bit (EGA/VGA) .BMP file format
  304. #       bmp256  8-bit (256-color) .BMP file format
  305. #       bmp16m  24-bit .BMP file format
  306. #       gifmono Monochrome GIF file format
  307. #       gif8    8-bit color GIF file format
  308. #       pcxmono Monochrome PCX file format
  309. #       pcxgray 8-bit gray scale PCX file format
  310. #       pcx16   Older color PCX file format (EGA/VGA, 16-color)
  311. #       pcx256  Newer color PCX file format (256-color)
  312. #       pbm     Portable Bitmap (plain format)
  313. #       pbmraw  Portable Bitmap (raw format)
  314. #       pgm     Portable Graymap (plain format)
  315. #       pgmraw  Portable Graymap (raw format)
  316. #       ppm     Portable Pixmap (plain format)
  317. #       ppmraw  Portable Pixmap (raw format)
  318. # *     tiffg3  TIFF/F (G3 fax)
  319.  
  320.   Lines beginning with a `#' are drivers included with the gs261
  321.   source distribution.
  322.  
  323.   Drivers marked with % require commercial software to work
  324.  
  325. Installations of ghostscript are available from several places:
  326.  
  327. A full, and presumably correct, installation is available in the SLS;
  328. note that this binary requires libX.so.???, as it includes the X11
  329. display driver.
  330.  
  331. The `official' installation is to obtain the sources and build it
  332. yourself:
  333.  
  334. prep.ai.mit.edu(or any gnu mirror):/pub/gnu/ghostscript-xxxx.tar.gz
  335. and                                         ghostscript-fonts-xxxx.tar.gz
  336.  
  337. This is probably best, as you can get the latest version (currently
  338. 2.6.1pl4 (the four patches are separate, they are available from my
  339. mail-server as gs261-patches-1-thru-4.tar.gz.uue)) without waiting for
  340. the SLS to get it in there.  Relying on softlanding will make your
  341. system inefficient; you certainly don't need drivers for every printer
  342. there is in your gs binary.  You should learn how to build things
  343. under unix yourself.  If you haven't the time, others do, and post
  344. binary installations independently from the SLS folk to major linux
  345. ftp sites.  (This is not an SLS bash; the SLS is most complete way to
  346. bootstrap yourself into the Linux world, but it is not very good for
  347. upgrading purposes).  One of these options may be needed if you don't
  348. have X libraries; the SLS binaries usually include the X11 device and
  349. therefore want the X libraries.
  350.  
  351. A minimal binary installation of ghostscript and several other
  352. packages needed for printing the linux documentation (which is in the
  353. works and comes in LaTeX - now in partial alpha release (!) and very
  354. well done, if I may say) is available as:
  355.  
  356. sunsite.unc.edu:/pub/linux/apps/tex/texmin/texmin-0.1.tar.z
  357.  
  358. Note that this does not contain any postscript fonts.  (Nor do you
  359. need them to print dvi (aka [La]TeX).)
  360.  
  361. The main Ghostscript documentation is contained in the file use.doc,
  362. either in the source directory, or ...lib/ghostscript/doc/use.doc if
  363. you haven't the sources.
  364.  
  365. To print ps, first determine your driver name with:
  366.  
  367. gs -help
  368.  
  369. which lists installed drivers.  If your favorite device is not listed,
  370. you must compile gs yourself from the source distribution (do not
  371. panic.  do follow the instructions in make.doc.  you will need 5 or 6
  372. megs of space to build it in.)  Then type
  373.  
  374. gs -dNOPAUSE -sDEVICE=?????? -sOutputFile=/dev/???? file.ps
  375.  
  376. and your output should (hopefully) appear at your printer.  Those of
  377. you with non-US paper sizes may wish to build gs yourself with the
  378. right default, or you may use the -sPAPERSIZE=a4 option.
  379.  
  380. Ghostscript may be used to print at most of the resolutions your
  381. printer supports; -r300, -r150, -r360x180 are examples of the option
  382. used to control this.  Dot matrix printers in general and 24 pin Epson
  383. compatibles in particular need to choose an appropriate resolution.
  384. Note that versions 2.6 and greater of ghostscript have more drivers.
  385.  
  386. ------------------------------
  387.  
  388. Subject: fonts
  389. From: gtaylor@cs.tufts.edu
  390.  
  391. (This section contains font information not specific to any
  392. ghostscript driver (nor even specific to ghostscript).  Font
  393. information pertaining to the X11 gs drivers (and thus to ghostview)
  394. is included in the ghostview section under previewing)
  395.  
  396. All versions of ghostscript come with assorted public-domain fonts,
  397. most of which were generated from bitmaps.  (meaning that they look
  398. bad).  However, ghostscript can use any Type 1 or 3 fonts you may have
  399. handy.  For example, the Adobe Type Manager (for any platform other
  400. than mac (a conversion util for mac ps fonts is on simtel in the
  401. windows3 directory)) comes with fonts you can use.  (get out some of
  402. that old windoze software :) .  There may be some licensing
  403. considerations, but if you're not a large company, no one will
  404. notice.  Place the fonts (*.pc?) in .../lib/ghostscript/fonts/ and add
  405. to your fontmap lines such as:
  406.  
  407. %(lines toward the end override earlier entries, so put these at the end)
  408. %(this is taken from the ms-dos distribution of gs on simtel-20)
  409. %(font names must be the same at in the actual font, but you may use
  410. % aliasing in this file to use a different font, read the docs)
  411.  
  412. % Fontmap.ATM - an alternative Fontmap for Ghostscript,
  413. % suitable for use with Adobe Type Manager fonts.
  414.  
  415. % Before you use ATM fonts with Ghostscript, please read carefully
  416. % the license that accompanies the ATM fonts; Aladdin Enterprises and
  417. % the Free Software Foundation take no responsibility for any possible
  418. % violations of such licenses.
  419.  
  420. % ATM fonts.
  421.  
  422. /Courier                        (com_____.pfb)  ;
  423. /Courier-Oblique                (coo_____.pfb)  ;
  424. /Courier-Bold                   (cob_____.pfb)  ;
  425. /Courier-BoldOblique            (cobo____.pfb)  ;
  426.  
  427. /Helvetica                      (hv______.pfb)  ;
  428. /Helvetica-Oblique              (hvo_____.pfb)  ;
  429. /Helvetica-Narrow               (phvrrn.gsf)    ;
  430. /Helvetica-Bold                 (hvb_____.pfb)  ;
  431. /Helvetica-BoldOblique          (hvbo____.pfb)  ;
  432.  
  433. /Symbol                         (sy______.pfb)  ;
  434.  
  435. /Times-Roman                    (tir_____.pfb)  ;
  436. /Times-Italic                   (tii_____.pfb)  ;
  437. /Times-Bold                     (tib_____.pfb)  ;
  438. /Times-BoldItalic               (tibi____.pfb)  ;
  439.  
  440. TimesNewRomanPS and ArialMT fonts are interchangable with Times Roman
  441. and Helvetica, so you can alias them this way if this is what you
  442. have.
  443.  
  444. Adobe Type 1 fonts may be found on the net:
  445.  
  446.          ftp.cica.indiana.edu:/pub/pc/win3/fonts
  447.          ftp.cica.indiana.edu:/pub/pc/win3/fonts/atm
  448.          archive.umich.edu:/msdos/mswindows/fonts
  449.  
  450. I have not looked in these places, but this information is lifted
  451. straight from the comp.fonts HOWTO (which you should read if fonts are a
  452. thing for you.  I'll be glad to mail you a copy).
  453.  
  454. Conversion between various font types is tricky.  Ghostscript comes
  455. with the tools needed to take a bitmap (hopefully large) and make a
  456. scalable ps font.  Groff comes with the tools to allow use of tfm
  457. (TeX) and pfb (Type 1) fonts in *roff documents.  X11R5 includes
  458. several font utilities and Type 1 rendering code contributed by IBM.
  459. I have used none of the above, but they all come with manpages, so
  460. read them.  Other font conversion utilities are listed in the
  461. comp.fonts HOWTO.  Also look into the package fontutils on
  462. prep.ai.mit.edu:/pub/gnu
  463.  
  464. ------------------------------
  465.  
  466. Subject: faxing
  467. From: gtaylor@cs.tufts.edu
  468.  
  469. If you have a fax modem, you can arrage to fax things out (and in),
  470. including PostScript, dvi, ascii, etc...  Arranging for e-mail to fax
  471. itself somewhere is also quite possible.
  472.  
  473. Fax modems correspond to one of two types: Classes 1 and 2.  Class one
  474. modems are fairly common and have less of what goes on in a fax
  475. supported in firmware (thus the software has to do more and do it
  476. carefully.  supporting such timing-critical things under a preemptive
  477. multitasking environment such as Linux is tricky at best).  The class
  478. 1 standard is EIA 578.  Class 2 modems tend to be more expensive and
  479. comply with the standard EIA 592.  Mention of your fax modem's level
  480. of support should be in its manuals.  Do not confuse class and group.
  481. You would be hard pressed to find a non-group III fax modem these days
  482. (but you probably could).
  483.  
  484. Most (all?) fax software which runs under linux must convert input in
  485. whatever format into a Group III compatible image format for
  486. transmission.  As usual, Ghostscript does the job.  The devices
  487. dfaxhigh and dfaxlow generate faxable output at the two common fax
  488. resolutions (200x200 and 200x100).  tiffg3 generates standard g3/tiff
  489. encoded fax messages.  You must compile them in if they are not there
  490. already; this is yet another reason to get the source.  Some fax
  491. sofware on commercial platforms can use the display PostScript
  492. renderer to render the fax image; this is not yet an option under
  493. Linux.
  494.  
  495. The GNU program netfax supports Class 2 fax modems only.  It builds
  496. nearly out of the box under linux.  I have patches for version 3.2.1.
  497. It runs a server and accepts jobs in a queue from the local machine
  498. and the net.  netfax is in use at MIT.  It accepts postscript, dvi,
  499. ascii, and can be configured to work as an email gate.  Documentation
  500. in the package is limited to compile notes and man pages for the
  501. individual programs; actual installation tips are few and far
  502. between.  But this is nothing new in linux :)
  503.  
  504. prep.ai.mit.edu:/pub/gnu/fax-3.2.1.tar.gz
  505.  
  506. FlexFax is available from:
  507.  
  508. sgi.com (192.48.153.1):/sgi/fax/?????.src.tar.Z
  509.  
  510. There is a beta containing a linux port; it built happily for me (but
  511. I haven't tried it yet).  It is written in C++, and thus requires g++
  512. to build.  It also links statically and seems to end up as a curiously
  513. large binary.  FlexFax supports class 1 and 2 modems, uses ghostview
  514. or a display postscript server for rendering, and generally is more
  515. complete, or at least general than the somewhat MIT-specific netfax.
  516. It also can run in place of getty and either receive a fax or spawn a
  517. login as appropriate for the type of call.
  518.  
  519. mgetty+sendfax is a Linux and SCO-specific getty for faxmodems and a simple
  520. sendfax program.  This package is on sunsite.
  521.  
  522. modgetty (which uses tcl, an interpreted language) can receive faxes.
  523. Try harbor.ecu.purdue.edu:/pub/tcl
  524.  
  525. efax is in beta, it offers simple fax functionality for Class 2 fax
  526. modems under Linux.
  527.  
  528. ------------------------------
  529.  
  530. Subject: {n,t,g}roff, man pages:
  531. From: gtaylor@cs.tufts.edu
  532.  
  533. Man pages can sometimes be printed straight from the cat pages which
  534. come with the SLS (in lieu of the normal nroff source pages) as though
  535. they were a normal text file (which they mostly are).  However, many
  536. printers do not like the VT escape codes for highlighting and what not
  537. that find themselves imbedded in these.  A filter for this purpose
  538. comes with the net-2 lpd package.  It is called lpf.
  539.  
  540. If you have the nroff source to the page (the finding of which I
  541. highly recommend) you can say:
  542.  
  543. man -t foobar |lpr
  544.  
  545. and your man program will (hopefully) format the man page using groff
  546. into PostScript, which will then be sent to your lpd and on to the
  547. printer.  This form of man page output looks MUCH better than the
  548. plain ASCII version.
  549.  
  550. If your man doesn't do this, you might try the perl version of man,
  551. available near:
  552.  
  553. sunsite.unc.edu:/pub/Linux/system/Manual-Pagers/man-pl*
  554.  
  555. It is written entirely in perl, and is thus easily customizable (perl
  556. being an interpreted language reminiscent of C and sh).
  557.  
  558. You can also find the nroff source file in the man directories (most
  559. mans have an option to just spit out the filename) and do it yourself,
  560. into any format supported by groff:
  561.  
  562. groff -mandoc -T{ascii,dvi,ps,X100,X75,latin8} foobar.1  \
  563.                                         [|{dvips,lpr}]
  564.  
  565. ------------------------------
  566.  
  567. Subject: mpage
  568. From: gtaylor@cs.tufts.edu
  569.  
  570. The package mpage is an ASCII postscript-ifyer and n-up reformatter
  571. for postscript.  It is available as:
  572.  
  573. wuarchive.wustl.edu:/pub/mirrors/unix-c/postscript/mpage.tar-z
  574.  
  575. or thereabouts.  Note that wuarchive uses the -z suffix to mean .Z,
  576. ie, compress, not GNUzip or freeze.
  577.  
  578. man -t foobar|mpage 
  579.  
  580. will send a 2-up (depending on the environment variable MPAGE) version
  581. of the man page to lpr and its postscript interpreter.  This saves
  582. paper and speeds up printing.
  583.  
  584. ------------------------------
  585.  
  586. Subject: a2ps
  587. From: gtaylor@cs.tufts.edu
  588.  
  589. A2ps will take ASCII and turn it into a nice postscript document with
  590. headers and footers and page numbers, printed two pages on one (or
  591. otherwise, if you say so).  A2ps does a very nice job at this.  It is
  592. available at the same place mpage is.
  593.  
  594. ------------------------------
  595.  
  596. Subject: enscript
  597. From: gtaylor@cs.tufts.edu
  598.  
  599. Enscript is a program which does basically the same thing as a2ps.  I
  600. do not know where to get it.  It comes with most unixes.
  601.  
  602. A clone version of enscript is called nenscript, available as 
  603. /pub/Linux/system/Printing/nenscript-1.13++.bin.tar.z or
  604. /pub/Linux/system/Printing/nenscript-1.13++.tar.z
  605.  
  606. on sunsite (?).
  607.  
  608. ------------------------------
  609.  
  610. Subject: gslp
  611. From: gtaylor@cs.tufts.edu
  612.  
  613. Gslp is one of the uilities which comes with ghostscript 2.6.x and
  614. purports to do the same ascii --> ps conversion as enscript and a2ps.
  615. I have not used it, but the docs say that
  616.  
  617. gs -q -sDEVICE=????? -dNOPAUSE -- gslp.ps text.file [options]
  618.  
  619. should do the trick.  (gslp.ps is the actual program, which is written
  620. in postscript.  Here it is run with the argument `text.file.'
  621. Postscript is in many respects a programming language more than a mere
  622. printer command language.)  Further documentation is in the file
  623. gslp.ps.  There is a script file which does the above for you.
  624.  
  625. ------------------------------
  626.  
  627. Subject: psutils
  628. From: gtaylor@cs.tufts.edu
  629.  
  630. Those of you who deal with large amounts of postscript may wish for
  631. more utility programs than come with the SLS.  There are probably
  632. millions of little programs which do things to your Postscript. A
  633. representative package of them may be found as:
  634.  
  635. achilles.doc.ic.ac.uk:/tex/inter/psutils/*
  636. or guardian.cs.psu.edu: /pub/src/psutil.tar.Z
  637.  
  638. These handle page selection, double-sided printing, booklet creation,
  639. etc.  Most large ftp sites (eg, wuarchive.wustl.edu, ftp.uu.uunet)
  640. will have many such packages to choose from.
  641.  
  642. ------------------------------
  643.  
  644. Subject: tex/dvi
  645. From: gtaylor@cs.tufts.edu
  646.  
  647. [La]TeX is the text formatting package used by many in the academic
  648. world and many in other places where people realize word perfect to be
  649. annoying.  TeX works much like any other compiler -- source code is
  650. run through the program `tex' to become a .dvi file (analogous to an
  651. .o object file in C) which can be further manipulated to produce
  652. printed output.  This manipulation of a dvi (device independant) file
  653. usually takes a little bit of doing.  This `bit of doing' is well
  654. worth it; TeX's output is of professional quality.
  655.  
  656. For those in the real world who cannot afford a dvi understanding
  657. printer, it is usually best to convert the dvi into postscript that
  658. you can pipe into ghostscript or lpr.  The SLS comes with a
  659. functioning installation of both TeX and dvips.  Typing
  660.  
  661. dvips -f1 file.dvi |lpr
  662.  
  663. will do it.  Dvips responds to either command line arguments or a file
  664. /usr/TeX/lib/tex/ps/config.ps (in the SLS, at least) in which you can
  665. arrange to have dvips automatically send its output to lpr.  Thus
  666.  
  667. dvips file.dvi
  668.  
  669. will do everything that needs to be done.  (this is much better than
  670. the 'manual' 
  671.  
  672. dvips -f1 file.dvi |gs -q -rxxx -dNOPAUSE -sDEVICE=xxx \
  673.                                         -sOutputFile=- - |/dev/????)
  674.  
  675. Note that some .dvi's may include PostScript graphics in the dvips
  676. stage rather than the tex stage of the game; if they are not found,
  677. you will get a hole instead of a picture.  This follows naturally from
  678. the object file analogy above :) Usually, pre-made documentation in
  679. this form has a makefile or script.  Lilo docs are an example of
  680. this.
  681.  
  682. Dvips has several interesting options; for exemple:
  683.  
  684. dvips -r1 file.dvi 
  685.  
  686. will print it out backwards.  We deskjet users love this one.
  687.  
  688. If all you are given is a file with a .tex ending, try either tex
  689. file.tex or latex file.tex.  One of these is bound to work.  Then you
  690. have a dvi.  (You may have to run it twice for indexing)
  691.  
  692. ------------------------------
  693.  
  694. Subject: dvilj
  695. From: gtaylor@cs.tufts.edu
  696.  
  697. For LaserJet owners, there is a separate program which I beleive is in
  698. the SLS that will take dvi and convert it directly into your printer's
  699. language (PCL).  It is called dvilj2p or dvilj, and if not on tsx or
  700. sunsite, is certainly available on ftp.uu.net.
  701.  
  702. (Description by Nils Rennebarth)
  703.  
  704. Its a nice driver, but a little out of fashion in the sense that
  705. configuration (especially of font-paths) font-paths is not very
  706. flexible and that it doesn't support virtual fonts (at least the
  707. version 0.51 not).  The biggest advantage over the dvips/ghostscript
  708. combo is that it uses downloadable fonts which:
  709.   a) reduces data transmission to the printer drastically, which 
  710.      makes the printer usable even on a serial line.
  711.   b) reduces printer-memory-requirements drastically. A standard 
  712.      Laserjet with 512k memory is able to print almost every
  713.      TeX-document.
  714.  
  715. It has support for double side printing and most options you expect a
  716. driver to have. It compiles cleanly and worked flawlessly on our
  717. diverse hardware here.
  718.  
  719. There are other specific dvi drivers for different printers, as well.
  720. I know of ones for the HP Deskjet and Epson.
  721.  
  722. ------------------------------
  723.  
  724. Subject: texinfo
  725. From: gtaylor@cs.tufts.edu
  726.  
  727. This is the native documentation format of the GNU project.  Emacs can
  728. be coerced into producing an info file out of this, and TeX can
  729. produce nice printed docs from the same file.  It is a bit of a
  730. stretch for both systems, but it works.  It is really just TeX source
  731. which expects the macro file texinfo.tex to be installed on your
  732. system.  The SLS ought to have the macro package.  Just do:
  733.  
  734. tex thefile.texi[nfo] 
  735.  
  736. twice (for index generation purposes), and you end up with a plain
  737. .dvi, to print or preview at your leisure.
  738.  
  739. In emacs, you can also do M-x texinfo-format-buffer to convert the
  740. texinfo file into an info file viewable with emacs M-x info or an info
  741. viewer of your choice.
  742.  
  743. ------------------------------
  744.  
  745. Subject: hardware and drivers
  746. From: gtaylor@cs.tufts.edu
  747.  
  748. (This information is based on perusal of the source to Linux 0.99p9
  749. and a letter from Michael K. Johnson.)
  750.  
  751. There are two ways the kernel driver may be used to run the parallel
  752. ports.  One, the original, is the polling driver.  The other is the
  753. interrupt driver.  In principle, the interrupt driver only deals with
  754. the port when it gets an interrupt and should therefore be more
  755. efficient.  In practice, people have found that it depends on the
  756. machine.  It probably doesn't make too much difference in most
  757. situations.
  758.  
  759. For the polling driver, you may adjust its polling frequency with the
  760. program lptune without kernel twiddling. The actual driver is in
  761. .../linux/kernel/chr_drv/lp.c.
  762.  
  763. To choose the interrupt driver rather than the polled, use the program
  764. lptune (or lpcntl) to set it.  (Lptune (and lpcntl) is available on
  765. sunsite, or from my mail-server.)  Just put the appropriate line in
  766. /etc/rc.
  767.  
  768. You can also change it in the kernel if you really want to.
  769.  
  770. Seven is the usual "LPT1:" IRQ, 5 is "LPT2:" for an AT class machine.
  771. Note that if your printer is on lp0, the interrupt driver will
  772. probably not work.  The first parameter should already contain the
  773. correct i/o base address.  Many bios boot screens have this
  774. information if you need it.
  775.  
  776. ------------------------------
  777.  
  778. Subject: Printer device names
  779. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  780. Reply-to: gtaylor@god.hounix.org (Grant Taylor)
  781.  
  782. On an XT bus system LPT1: becomes /dev/lp0 (major=6, minor=0),
  783. on an AT LPT1: becomes /dev/lp1 (major=6, minor=1). To be more
  784. precise: 
  785.  
  786. Name Major Minor I/O address
  787.  lp0   6     0       0x3bc
  788.  lp1   6     1       0x378
  789.  lp2   6     2       0x278
  790.  
  791. For a serial printer use the ttyS? (or ttys?, if you follow that
  792. scheme) device, not the cua?  device. The ttyS? devices have major 4;
  793. the cua? devices have major 5.
  794.  
  795. ------------------------------
  796.  
  797. Subject: LPR                <<<<<<------------
  798. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  799.  
  800. This section used to the the lpd-HOWTO then it became part of the
  801. linux-HOWTO and now it is part of printing.how-to. Who knows where it
  802. will go next?
  803. --
  804.     \\   ( )   No Bullshit!   | Email: B.A.McCauley@bham.ac.uk
  805.  .  _\\__[oo       from       | Voice: +44 21 471 3789 (home)
  806. .__/  \\ /\@  /~)  /~[   /\/[ |        +44 21 627 2171 (work)
  807. .  l___\\    /~~) /~~[  /   [ |   Fax: +44 21 627 2175 (work)
  808.  # ll  l\\  ~~~~ ~   ~ ~    ~ | Snail: 197 Harborne Lane, B29 6SS, UK
  809. ###LL  LL\\ (Brian McCauley)  |  ICBM: 52.5N 1.9W
  810.  
  811. ------------------------------
  812.  
  813. Subject: What lpr and lpd do 
  814. From: gtaylor@cs.tufts.edu (Grant Taylor)
  815. Reply-to: B.A.McCauley@bham.ac.uk (Brian McCauley)
  816.  
  817. Most unix systems use lpd (or the System V variant lp), the line
  818. printer daemon, and friends to spool print jobs and run them through
  819. all needed filters.  While line printers are certainly on their way
  820. out, spooling print jobs and running them through filters is
  821. definitely a convenient thing.  Thus lpr.  (subliminal note: PLEASE
  822. find and read the lpr, lpd, printcap, lpc, lpq, and lprm man pages.
  823. They are in the source dist of the net-2, if you haven't got them.)
  824.  
  825. Lpd and family are available in several places.  The new Linux net-2
  826. package contains a working lpd.  I now use this one with my stock
  827. 0.99pl10 kernel after following the directions in Matt Welsh's net-2
  828. HOWTO to get my NET-2 going (you only need loopback).  A binary package
  829. which can be coaxed into working with the old net things (pre 0.99pl10
  830. kernel) is in the SLS.  Note a subtle difference between the two
  831. versions: the old one placed lock files and such in /var/spool, while
  832. the net-2 version requires the directory /var/spool/lpd to exist for
  833. it's lock file.
  834.  
  835. You will need to edit /etc/printcap to configure lpd to use your
  836. printer. Setting up lpd to accept postscript and print it is not very
  837. difficult; simply make a shell script fiter (qv).
  838.  
  839. Setting up lpr correctly is definitely worth the trouble if you are
  840. going to do any printing at all.  Of course, if all you ever print is
  841. the occasional man page or instruction book, then you can probably get
  842. by without it (but even then it's nice).
  843.  
  844. Ghostscript 2.6.x also comes with a complicated script and utilities
  845. to generate printcap entries and manage multiple types of queues for a
  846. printer.  I have not tested these, but I assume they can be made to
  847. work.  If you are in a large-scale environment with varied printing
  848. needs, these are probably worth a look.
  849.  
  850. ------------------------------
  851.  
  852. Subject: Where do the files go and what should their permissions be?
  853. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  854.  
  855. There is quite a bit of variation between the various releases
  856. but I'll try where possible to offer solutions that are universally
  857. applicable. Put /etc/lpd in your /etc/rc or /etc/rc.local (usually in
  858. /etc/rc.local after you start syslogd (if you use syslogd)).
  859.  
  860. Set the group fields of the file permissons/ownership as follows:
  861.  
  862. -rwxr-s---   1 root     lp          37892 Nov 19 23:32 /etc/lpd
  863. -rwx--s--x   1 root     lp          21508 Nov 19 23:32 /usr/bin/lpc
  864. -rws--s--x   1 root     lp          17412 Nov 19 23:32 /usr/bin/lpq
  865. -rwx--s--x   1 root     lp          17412 Nov 19 23:32 /usr/bin/lpr
  866. -rwx--s--x   1 root     lp          17412 Nov 19 23:32 /usr/bin/lprm
  867. -rwxr-xr-x   1 root     lp           2816 May 10 13:37 /usr/bin/lptest
  868.  
  869. ...and for each of the spool directories listed in the sd fields of
  870. /etc/printcap... 
  871.  
  872. /var/spool/lpd:
  873. total 5
  874. drwxrwxr-x   2 root     lp           1024 May 18 23:00 .
  875. drwxr-xr-x  11 root     root         1024 Feb 19 20:56 ..
  876. -rw-rw-r--   1 root     lp              4 May 18 23:00 .seq
  877. -rw-rw-r--   1 root     lp             18 May 18 23:00 lock
  878. -rw-rw-r--   1 root     lp             25 May 18 23:00 status
  879.  
  880. Note these 3 files are created by lpr and lpd so if you've never
  881. run these they will be absent and you should touch them into being.
  882.  
  883. In older versions the group was ``daemon'' not ``lp''. There's also
  884. a named socket but lpd creates/deletes it as needed.
  885.  
  886. Some of these permissions may be overkill so don't be surprised if
  887. your system works with different permissions. The fact that lpq needs
  888. to be suid(root) is inelegant and may change in the future. People tell
  889. me that lpr must be suid(root) but I've not seen evidence that this
  890. is really the case as long as the file permissions on the spool queues
  891. are right. Still as far as I know lpr is designed to be secure when
  892. installed setuid(root).
  893.  
  894. Alternative approach: just make lpc, lpr and lprm setuid(root) then
  895. you can almost forget the file permissions on the spool queues!
  896.  
  897. You're free to choose different directories for the executables on
  898. your system (notably lpc is usually in /etc even though it has
  899. commands that are useful to non-root).
  900.  
  901. The master lpd lock file is fixed at compile time to be
  902. /var/spool/lpd/lpd.lock so you must have a /var/spool/lpd directory
  903. even if you choose not to keep your spool queue there. In the older
  904. binaries the lock file was /usr/spool/lpd.lock so this was not an
  905. issue.
  906.  
  907. My advise is keep your primary spool queue in /usr/spool/lpd and make
  908. /var a symlink to usr or keep it in /var/spool/lpd and make /usr/spool
  909. a symlink to ../var/spool. This gives the greatest compatibility with
  910. the pathnames that are compiled into the various distributed binaries.
  911.  
  912. The main configuration file is /etc/printcap although the old binaries
  913. look for it in /usr/etc/.  The old binaries' README says hosts.equiv
  914. and hosts.lpd files are looked for in /etc/inet but again the more
  915. accepted convention is to locate them in /etc.
  916.  
  917. Since, IMHO, working out in which particular etc directory each file
  918. should reside is tedious, I would advise having only one:
  919.  
  920. mv -i /usr/etc/inet/* /etc/inet/* /usr/etc/* /etc/
  921. rmdir /usr/etc/inet /etc/inet /usr/etc
  922. ln -s ../etc /usr/etc
  923. ln -s . /etc/inet
  924.  
  925. [But make sure the files in /usr/etc and /etc/inet are not already
  926. symlinks into /etc or you'll be in deep water.]
  927.  
  928. This makes your /etc huge but I think it's safe. All the latest stuff
  929. has only /etc paths compiled into it so eventually we can get rid of
  930. these links.
  931.  
  932. ------------------------------
  933.  
  934. Subject: What are all these diretories for?
  935. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  936.  
  937. People like to put all things that aren't needed during bootstrap in
  938. /usr so that / is as small as possible. They therefore move
  939. unessential big files (usually the binaries) from /etc/ to /usr/etc/.
  940.  
  941. Unless you know what you are doing (or following the example of
  942. someone that does) I'd advise keeping it all in /etc with /usr/etc and
  943. /etc/inet being symlinks back to /etc. (In fact these links are
  944. probably soon to be redundant as most recent binaires now look in
  945. /etc/.)
  946.  
  947. The Linux/PRO approach is to have a real /usr/etc directory containing
  948. all the non-essential stuff and make symlinks to each file therein
  949. from its namesake in /etc. To spread out the configuration files for
  950. the sake of tidiness there is a directory tree called /conf and many
  951. files in /etc symlinks into this tree.
  952.  
  953. Also a few people like all their internet stuff in /etc/inet but as
  954. recent binaries excpect to find this stuff in /etc they must create
  955. links for each file from /etc into /etc/inet.
  956.  
  957. To avoid the problem of your /usr filesystem filling up as a result of
  958. stuff in spool queues some poeple perfer to keep their spool queues
  959. and such like in a separate filesystem called /var. If you don't have
  960. a /var file system then you should make /var a symlink to usr. If you
  961. _do_ have a /var filesystem to may want to make /usr/spool a symlink
  962. to ../var/spool so that any programs expecting to find /usr/spool will
  963. not be dissapointed.
  964.  
  965. ------------------------------
  966.  
  967. Subject: lpd not working
  968. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  969.  
  970. If ``ps ax'' does not reveal a lpd then you daemon has died (or was
  971. never started) - usually a sign that it couldn't create its lockfile
  972. (or you tried to start it before all your filesystems were mounted).
  973.  
  974. If lpr works only for root then you've probably got a permission problem.
  975.  
  976. If you get ``jobs queued, but cannot start daemon'' or ``lpc: connect:
  977. No such file or directory'' you are having trouble with the socket
  978. connection to lpd. "start" in the context of this error really means
  979. "wake". I don't really understand this but the problem was common in
  980. early days with the old binaries but developments in the TCP/IP code
  981. in the kernel fixed it for most people. Basically is stems from a
  982. network porblem. If you're not on a network then try congifuring
  983. youself as a single node network and the problem should vanish.
  984.  
  985. ------------------------------
  986.  
  987. Subject: Where do I get a printcap for a xxxxx?
  988. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  989.  
  990. This question is essentially meaningless - see next question.
  991.  
  992. ------------------------------
  993.  
  994. Subject: The semantics of /etc/printcap
  995. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  996.  
  997. Given the similarity in appearence and name between /etc/termcap and
  998. /etc/printcap one could be forgiven for assuming that they contain
  999. analogous infomation. This is not the case. Whereas termcap contains
  1000. informations about terminal *types* - (mostly escape seqences)
  1001. printcap contains information about *specific* printers (like the
  1002. directory that holds the spool queue and the device name of the
  1003. printer). The information about a printer model's escape sequences and
  1004. so on are held in the various filters which are _programs_ called by
  1005. lpd to drive the printer. /etc/printcap simply gives the locations of
  1006. these filters.  For details RTFM(printcap). [Alternatively the net-HOWTO
  1007. has a summary of some of the more important fields.]
  1008.  
  1009. One last point you should always specify ``suppress header'' ``:sh:''
  1010. unless you have *text* (_not_ postscript) printer and want banners. On
  1011. a text printer they are usually a waste of time and paper. On a
  1012. postscript printer they usually stop your printer working.  (See the
  1013. banners question for further expanation).
  1014.  
  1015. ------------------------------
  1016.  
  1017. Subject: The syntax  of a /etc/printcap
  1018. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1019.  
  1020. Ideally RTFM(termcap) (yes, I said *termcap*) but since most people
  1021. don't have TFM(termcap) here are the essentials.
  1022.  
  1023. Lines starting # are comments (as you might have guessed).
  1024.  
  1025. For each printer usable from the lpr command on your system there is
  1026. one logical line in the file. For the sake of readability each logical
  1027. line may be spread over several physical lines by making the last
  1028. character on all but the last physical line a backslash.
  1029.  
  1030. Each logical line has the following format:
  1031.  
  1032. name1|name2|name3:string_capability=string:\
  1033.        :numeric_capability#number:boolean_capability:
  1034.  
  1035. The leading spaces and colon on the second line are for readability
  1036. only.
  1037.  
  1038. A printer can have as many names as you like but conventionally the
  1039. final name is used as a longhand description of the printer. (Still
  1040. people are free to say `lpr -P "Fred's grotty teletype"' if that's
  1041. the description you've given.)
  1042.  
  1043. The list of capabilities can be as long as needed and the order is not
  1044. significant. Each ``capability'' is denoted by a two character code.
  1045. (The name ``capability'' comes form the file format's termcap heritage
  1046. - parameter or attribute would be a more sensible terms.) [Note from
  1047. Ross Biro: capabilities with 3 character names don't work properly
  1048. which is why the serial port stuff in the old binaries failed.]
  1049. Capabilities having string value and have a = delimiter between the
  1050. capability name and the value while those having a numeric value use a
  1051. # (actually they can use either a # or an =). Boolean ``capablilties''
  1052. are true if they appear in the list and false if they do not.
  1053.  
  1054. Special characters in a string value can be expressed using `\'-escape
  1055. sequences as in C; in addition, `\E' stands for ESC.  `^' is also a
  1056. kind of escape character; `^' followed by CHAR stands for the
  1057. control-equivalent of CHAR.  Thus, `^a' stands for the character
  1058. control-a, just like `\001'. `\' and `^' themselves can be represented
  1059. as `\\' and `\^' respectively. `\:' for `:' seems to work but the
  1060. source code contains a waring that it can confuse the parser and
  1061. `\072' is a better idea.
  1062.  
  1063. Example:
  1064.  
  1065. lp|bam|BAM's Epson FX-80:lp=/dev/lp1:sd=/usr/spool/lp1:sh:mx#0:\
  1066.         :df=/usr/local/lib/magic-filter/lp.df:\
  1067.         :if=/usr/local/lib/magic-filter/lp.if:
  1068.  
  1069. Name is lp (this is the printer that lpr uses by default). It's also
  1070. known as bam or "BAM's Epson FX-80".
  1071.  
  1072. The printer is on /dev/lp1 (aka AT-bus LPT1:). I don't want a burst
  1073. page. I don't want a file length limit. Files queued by `lpr -d' are
  1074. passed through /usr/local/lib/magic-filter/lp.df and those queued by
  1075. `lpr' through /usr/local/lib/magic-filter/lp.lf.
  1076.  
  1077. See also the next section.
  1078.  
  1079. ------------------------------
  1080.  
  1081. Subject: An /etc/printcap gotcha.
  1082. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1083.  
  1084. Two /etc/printcap files can look identical and yet one works and the
  1085. other doesn't.
  1086.  
  1087. See if ``lpc stat'' reports a printer called ` :'. The last
  1088. character on a continued line must be a \. If there are whitespace
  1089. characters after the \ then it doesn't register the next line as a
  1090. continuation.
  1091.  
  1092. ------------------------------
  1093.  
  1094. Subject: The minimum /etc/printcap?
  1095. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1096.  
  1097. This is a silly question but it _is_ frequently asked. The answer is
  1098. ``lp:sh'' (that's 6 bytes including the required linefeed character on
  1099. the end). To use this /etc/printcap you must make /dev/lp a symlink to
  1100. your printer and create your spool queue directory as /usr/spool/lpd.
  1101. (You might think that if you wanted banner pages you could loose the
  1102. ``:sh'' but the termcap syntax requires at least one capability per
  1103. entry).
  1104.  
  1105. ------------------------------
  1106.  
  1107. Subject: How do I prevent the `staircase effect'?
  1108. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1109.  
  1110. Unix terminates each line of a file with a linefeed but not a
  1111. carriage return so taken literally a Unix text file printed on an
  1112. ASCII device will start each line below the end of the previous line.
  1113. Some printers can be set to treat "linefeed" as "carriage return,
  1114. linefeed", others can't. If yours can then do simply do that. If the
  1115. printer cannot be fixed create a shell script filter that reads:
  1116.  
  1117. #!/bin/sh
  1118. if [ $1 = -c ]; then
  1119.   cat
  1120. else
  1121.   sed -e s/$/^M/
  1122. fi
  1123. # the ``echo -ne'' assumes that /bin/sh is realy bash
  1124. echo -ne \\f
  1125.  
  1126. where ^M is a carriage return character not a ^ followed by a M.  To
  1127. type ^M in emacs use the sequence C-q C-m and in vi use C-v C-m.
  1128. Conventionally this script is called /usr/lib/lpf. The test of $1
  1129. allows the isertion of carriage returns to be switched off by the `-l'
  1130. switch on lpr.
  1131.  
  1132. Alternatively your printer may have an escape sequence that will set
  1133. the way it handles linefeed characters. A simple filter that uses an 
  1134. `echo -ne' command to send this sequence may be appropriate.
  1135.  
  1136. #!/bin/sh
  1137. # Filter for HP printers to treat LF as CRLF  
  1138. # the ``echo -ne'' assumes that /bin/sh is realy bash
  1139. echo -ne \\033\&k2G
  1140. cat
  1141. echo -ne \\f
  1142.  
  1143. ------------------------------
  1144.  
  1145. Subject: Resetting the printer after each printout
  1146.  
  1147. Either make your filters do it or define the `tr' ``capability'' in
  1148. /etc/printcap to be your printer's font reset command. For details of
  1149. the format of this string see the question on the format of
  1150. printcap. This may not work if a printout crashes in the middle of an
  1151. escape sequence - putting a lot of ^@ on the front may help but this
  1152. probably won't be enough it you were printing raster graphics when the
  1153. filter died.
  1154.  
  1155. ------------------------------
  1156.  
  1157. Subject: Preventing formfeed after each printout
  1158. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1159.  
  1160. If you don't have an `if' specified in /etc/printcap then lpd will
  1161. automatically put a formfeed at the end of each file. If you're using
  1162. a filter then it's up to the filter to decide if it wants to put a
  1163. formfeed. To disable formfeed completely if you don't have an `if' put
  1164. :ff=: in your /etc/printcap.  But please note this suppresses the
  1165. formfeed that would usually be printed if a filter dies. If you want
  1166. formfeeds after text printouts but not on printouts printed with `lpr
  1167. -l' then create the following `if' filter:
  1168.  
  1169. #!/bin/sh
  1170. # the ``echo -ne'' assumes that /bin/sh is realy bash
  1171. cat
  1172. if [ "$1" != -c ]; then
  1173.   echo -ne \\f
  1174. fi
  1175.  
  1176. If you want a formfeed after `lpr -l' to be optional you can misuse the
  1177. `-i' switch to suppress the formfeed with the following trick (after
  1178. all `lpr -i -l' would usually not be implemented).
  1179.  
  1180. #!/bin/sh
  1181. cat
  1182. # use lpr -i -l to print raw without trailing formfeed
  1183. if [ "$1" != -c -o "$4" = -i0 ]; then 
  1184.   # the ``echo -ne'' assumes that /bin/sh is realy bash
  1185.   echo -ne \\f
  1186. fi
  1187.  
  1188. ------------------------------
  1189.  
  1190. Subject: Printing to a serial port
  1191. From: teffta@engr.dnet.ge.com (Andrew Tefft)
  1192. Reply-to: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1193.  
  1194. The first section applies to both net-2 and pre-net-2 implementations
  1195. of lpd; then there is a section applicable only to the older
  1196. implementation; the rest applies to net-2 only.
  1197.  
  1198. First, there is a kernel patch you need to make. This applies to
  1199. pre-net-2 lpd as well (actually, the use of this should probably
  1200. just be commented out of the lpd source code). The change is for
  1201. at least patchlevel 10, but probably all others as well.
  1202.  
  1203. in /usr/src/linux/kernel/chr_drv/tty_ioctl.c, around line 390,
  1204. you will see:
  1205.  
  1206.                 case TIOCEXCL:
  1207.                         return -EINVAL; /* not implemented */
  1208.  
  1209. Change this to return 0, recompile the kernel, and you'll be all set.
  1210.  
  1211. The following applies only to the "old" lpd, before net-2.
  1212.  
  1213. You cannot set any serial port settings (including baud rate) in your
  1214. printcap. Leave them all out and use stty to set up the port (if necessary)
  1215. in your rc.local, and you should be all set (to find the correct
  1216. stty settings, start with the default and twiddle until you can correctly
  1217. cat a file out the port).
  1218.  
  1219. The rest of this applies only to net-2 lpd although it may be
  1220. helpful to read. I put more detail into this because it's what I use.
  1221.  
  1222. ------------------------------
  1223.  
  1224. Subject: Serial settings in printcap
  1225. From: teffta@engr.dnet.ge.com (Andrew Tefft)
  1226. Reply-to: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1227.  
  1228. There are two sets of flags which you will need to set, plus
  1229. the baud rate (Note: the "fc" flag setting seems to override the br#
  1230. capability, so be sure to set that correctly as well as the br#!).
  1231.  
  1232. Each of the flags can have bits set and cleared. Clearing is done
  1233. first, so specify the clear flags (fc# and xc#) before the set flags
  1234. (fs and xs).
  1235.  
  1236.    Setting the br# capability is self-explanatory. Example: br#9600
  1237.  
  1238.    It is very easy to translate from 'stty' settings to printcap flag
  1239.    settings. If you need to, see the man page for stty now. 
  1240.  
  1241.    Use stty to set up the printer port so that you can cat a file
  1242.    to it and have it print correctly. Here's what "stty -a" looks like
  1243.    for my printer port:
  1244.  
  1245. dina:/usr/users/andy/work/lpd/lpd# stty -a < /dev/ttyS2
  1246. speed 9600 baud; rows 0; columns 0; line = 0;
  1247. intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
  1248. eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
  1249. lnext = ^V; min = 1; time = 0;
  1250. -parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
  1251. -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon -ixoff
  1252. -iuclc -ixany -imaxbel
  1253. -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
  1254. ff0
  1255. -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop
  1256. -echoprt -echoctl -echoke
  1257.  
  1258.    The only changes between this and the way the port is initialized
  1259.    at bootup are -clocal, -crtscts, and ixon. Your port may well be
  1260.    different depending on how your printer does flow control.
  1261.  
  1262.    Once you have your stty settings right, so that cat file > /dev/ttyS2 
  1263.    (in my case) sends the file to the printer, look at the
  1264.    file /usr/src/linux/include/linux/termios.h. This contains a lot of
  1265.    #defines and a few structs (You may wish to cat this file to the
  1266.    printer (you do have that working, right?) and use it as scratch paper
  1267.    -- I did!). Go to the section that starts out
  1268.  
  1269. /* c_cflag bit meaning */
  1270. #define CBAUD   0000017
  1271.  
  1272.    This section lists the meaning of the "fc#" and "fs#" bits.
  1273.    You will notice that the names there (after the baud rates) match
  1274.    up with one of the lines of stty output. Didn't I say this was going
  1275.    to be easy?
  1276.  
  1277.    Note which of those settings are preceded with a - in your stty
  1278.    output. Sum up all those numbers (they are octal). This represents the 
  1279.    bits you want to *clear*, so the result is your fc# capability.
  1280.    Of course, remember that you will be setting bits directly after
  1281.    you clear, so you can just use fc#0177777 (I do).
  1282.  
  1283.    Now do the same for those settings (listed in this section) which
  1284.    do not have a - before them in your stty output. In my example 
  1285.    the important ones are CS8 (0000060), HUPCL (0002000), and CREAD (0000200).
  1286.    Also note the flags for your baud rate -- mine is 0000015. Add those
  1287.    all up, and in my example you get 0002275. This goes in your fs#
  1288.    capability (fs#02275 works fine in my example).
  1289.  
  1290.    Do the same with set & clear for the next section of the include file,
  1291.    "c_lflag bits". In my case I didn't have to set anything, so I just
  1292.    use "xc#0157777" and "xs#0". 
  1293.  
  1294.    Once your printcap is set up, try it out. If things don't work, 
  1295.    see the next section.
  1296.  
  1297. ------------------------------
  1298.  
  1299. Subject: cat works to the serial port, but not lpd (1)
  1300. From: teffta@engr.dnet.ge.com (Andrew Tefft)
  1301. Reply-to: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1302.  
  1303. Generally getting lpd up and running is explained elsewhere, but if
  1304. you are having trouble with serial port settings you can prevent lpd
  1305. from trying to configure your port by treating you printer as one that
  1306. does not present a normal device interface (qv).
  1307.  
  1308.    1. Set your printer (in your printcap) to /dev/null1. Create /dev/null1
  1309.       using mknod /dev/null1 c 1 3 (because you don't want /dev/null to be
  1310.       opened exclusively).
  1311.  
  1312.       remove the baud rate and flags settings from your printcap.
  1313.  
  1314.    2. Create a script such as this:
  1315.  
  1316. #!/bin/sh
  1317. echo if: $* >> /var/spool/lpd/results
  1318. # /dev/lp is linked to /dev/ttyS2 which has the printer
  1319. exec your-old-input-filter $* > /dev/lp
  1320.  
  1321.    ...or if you didn't have an old if installed...
  1322.  
  1323. #!/bin/sh
  1324. echo if: $* >> /var/spool/lpd/results
  1325. cat > /dev/lp
  1326. # the ``echo -ne'' assumes that /bin/sh is realy bash
  1327. echo -en \\f > /dev/lp
  1328.  
  1329.       Make sure it's world-executable and world-readable. I call my
  1330.       script /var/spool/lpd/if, to make things easy. Try out
  1331.       your script (/var/spool/lpd/if < somefile) and see if it prints.
  1332.  
  1333.    3. Set the if= capability in your printcap to call this script,
  1334.       e.g. if=/var/spool/lpd/if
  1335.  
  1336.    4. Use stty to correctly set your port settings. Try to print now.
  1337.       You should be able to tell if things are being spooled, and
  1338.       things *should* be printed, if your manual testing of the if
  1339.       script works. But this is a kludge, so the idea is not to use the
  1340.       if script.
  1341.  
  1342. ------------------------------
  1343.  
  1344. Subject: cat works to the serial port, but not lpd (2)
  1345. From: teffta@engr.dnet.ge.com (Andrew Tefft)
  1346. Reply-to: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1347.  
  1348. Assuming the above method using the "if" filter works and that
  1349. you belive that you have specified what you think are the correct
  1350. flags and baud rate in printcap; check ``stty -a < /dev/ttyS2'' (or
  1351. whatever your printer port is).  If the settings are not correct,
  1352. check your flags against your printout from termios.h. If the settings
  1353. are *way* not correct, you may need to fix lpd itself. The patch
  1354. follows, and you can probably see why it's needed :-) It gets applied
  1355. in the lpd/ subdirectory of the lpd source.
  1356.  
  1357. (the patch is coming in just a sec)
  1358.  
  1359. When I was setting mine up, I followed a sequence like this:
  1360.  
  1361. lprm (whatever -- make sure queue is empty and lpd is running)
  1362. stty (correct settings) < /dev/ttyS2
  1363. lpr (something small)
  1364. stty -a < /dev/ttyS2   (often had to ctrl-c out of this one)
  1365. (twiddle with flags)
  1366. lprm (whatever -- make sure queue is empty again...)
  1367.  
  1368. Here's the patch (I think its reversed so apply it with -R):
  1369. -------------------------------Cut Here-------------------------------------
  1370. *** printjob.c  Thu Jul  8 20:56:59 1993
  1371. --- printjob.c~ Sat Feb 27 09:07:01 1993
  1372. ***************
  1373. *** 1271,1277 ****
  1374.         }
  1375.   #ifdef LINUX
  1376.         ttybuf.c_cflag &= ~FC;          /* not quite right! */
  1377. !       ttybuf.c_cflag |= FS;           /* not quite right! */
  1378.   #else
  1379.         ttybuf.sg_flags &= ~FC;
  1380.         ttybuf.sg_flags |= FS;
  1381. --- 1271,1277 ----
  1382.         }
  1383.   #ifdef LINUX
  1384.         ttybuf.c_cflag &= ~FC;          /* not quite right! */
  1385. !       ttybuf.c_cflag |= ~FS;          /* not quite right! */
  1386.   #else
  1387.         ttybuf.sg_flags &= ~FC;
  1388.         ttybuf.sg_flags |= FS;
  1389. -------------------------------Cut Here-------------------------------------
  1390.  
  1391. ------------------------------
  1392.  
  1393. Subject: Printers that aren't simple character devices
  1394. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1395.  
  1396. [Firstly I'll explain the subject.] The most common example is a
  1397. printer that is connected via a network in some strange way.  For
  1398. example consider a printer conneccted to a host running some esoteric
  1399. OS with which you can only communicate via E-mail. To use this printer
  1400. without going through lpr you would say something like:
  1401.  
  1402.   | uuencode tmp | mail printer-request@eosteric
  1403.  
  1404. in place of: 
  1405.  
  1406.   > /dev/lp
  1407.  
  1408. To use such a printer through lpr the ``lp'' capability of the print
  1409. queue should be directed to a /dev/null type device (e.g. ``mknod
  1410. /dev/null1 c 1 3'') but not /dev/null itself as lpd opens the device
  1411. exclusively. _Each_ filter must must explicitly uuencode and mail its
  1412. output. In more complex cases if you already have an ``if'' or ``of''
  1413. filter for a strangely connected printer then other filters can pass
  1414. their output to/through this filter to avoid duplication of effort.
  1415. In this case the ``if'' filter should usually be called with the
  1416. ``-c'' switch to minimise the further manipulations if performs.
  1417.  
  1418. ------------------------------
  1419.  
  1420. Subject: Getting burst/banner pages
  1421. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1422.  
  1423. For a simple text printer (in particular not postscript) and a
  1424. simple text banner simply take :sh: out of the printcap record. If you
  1425. want to prevent the banner comming out in whatever font was last used
  1426. on the printer then define the `tr' ``capability'' to be your
  1427. printer's font reset command.
  1428.  
  1429. If you want a fancy customised banner (or have a postscript printer)
  1430. leave :sh: in the printcap and make each of your filters print the
  1431. banner. All the information to put on the banner is included in the
  1432. filter's positional parameters.  RTFM(printcap) for details. [ If
  1433. you're using <B.A.McCauley@bham.ac.uk>'s magic-filter package then
  1434. call the code to print the banners from the config script. ]
  1435.  
  1436. ------------------------------
  1437.  
  1438. Subject: Printing text on a PS printer
  1439. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1440.  
  1441. You need a filter based on a program that converts ascii to
  1442. postscript. The most well known of these is ``enscript'' but it's also
  1443. the hardest to find. Others include ``a2ps'' and ``mpage'' (for
  1444. details of these see elsewhere in this document).
  1445.  
  1446. ------------------------------
  1447.  
  1448. Subject: Trunation of graphics files
  1449. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1450.  
  1451. This is usually because you've got a limit set on the maximum size
  1452. file that can sit in the spool queue. Put `mx#0' in your printcap.
  1453.  
  1454. ------------------------------
  1455.  
  1456. Subject: Why doesn't `lpr -i' work?
  1457. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1458.  
  1459. To get lpr -i to work you need a filter istalled as `if' that
  1460. implements it.  The -i switch is simply passed on by lpd to the filter.
  1461. There is such a filter usually called /usr/lib/lpf that can be obtained from
  1462. bsd source archives in the directory bsd-source/lpr/filters.  It's also part
  1463. of Fred's port but he put it in /usr/bin/.  If you whant to use this program
  1464. but still want your filter to do some printer specific initialisation then
  1465. write script thus:
  1466.  
  1467. #!/bin/sh
  1468. # My initialisation stuff goes here
  1469. exec /usr/lib/lpf $*
  1470.  
  1471. ------------------------------
  1472.  
  1473. Subject: Why doesn't `lpr -p' work?
  1474. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1475.  
  1476. Because it's broken. lpd always thinks that the printer is 0
  1477. characters wide regardless of what printcap says. Previous versions of
  1478. the lpd-HOWTO contained a patch but it has now been applied to the
  1479. latest distribution of the net-2 stuff.
  1480.  
  1481. One other thing: lpd calls pr by full pathname so if you keep pr
  1482. somewhere different from /usr/bin/pr you will need a symlink.
  1483. (Where lpd expects to find pr may vary from version to version).
  1484.  
  1485. ------------------------------
  1486.  
  1487. Subject: lprm says `too many users'
  1488. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1489.  
  1490. You have an anchient libc.so with a broken scandir().
  1491.  
  1492. ------------------------------
  1493.  
  1494. Subject: lpc complains that it hasn't stopped a daemon
  1495. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1496.  
  1497. One lpd process runs all the time and it spawns children to
  1498. handle each printer as needed. Sometimes these children leave lock
  1499. files lying about. This is harless.
  1500.  
  1501. ------------------------------
  1502.  
  1503. Subject: lpr over a network
  1504. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1505.  
  1506. To print on the printer listed as foor "foo" in the printcap on machine
  1507. "bar.baz.net" from the machine "mine.baz.net" you put an entry like
  1508. this in your /etc/printcap (on mine.baz.net):
  1509.  
  1510. foo:lp=:rm=bar.baz.net:rp=foo:sd=/usr/lpd/spool/foo:
  1511.  
  1512. and, of course, create the spool directory /usr/lpd/spool/foo.
  1513.  
  1514. There's no point specifying filters and the like in
  1515. mine.baz.net:/etc/printcap as it's the ones in
  1516. bar.baz.net:/etc/printcap that will get used.
  1517.  
  1518. On the machine bar.baz.foo, you need to put "mine.baz.net" on a line
  1519. by itself in either /etc/hosts.equiv or /etc/hosts.lpd; note that
  1520. putting it in /etc/hosts.equiv will allow for unauthenticated logins as
  1521. well as printing.  /etc/hosts.lpd is printing only.
  1522.  
  1523. ------------------------------
  1524.  
  1525. Subject: Writing lpd filters
  1526. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1527.  
  1528. In normal Unix terminology, filters are just programs (so they
  1529. must have execute permission) that read a stream from their standard
  1530. input and write to their standard output.
  1531.  
  1532. lpd filters are filters in the sense that thay read STDIN and write to
  1533. STDOUT, but are unusual in that they may assume that their standard
  1534. input is a file and perform lseek() operations on it.
  1535.  
  1536. All lpd filters have a common command line syntax (or more often
  1537. simply ignore command line parameters). For details of the command
  1538. line parameters RTFM(printcap).
  1539.  
  1540. It's easier to debug filters if you test them in an immediate shell
  1541. before you install them. (If your filter makes use of its command line
  1542. arguments you'll have to specify them too).
  1543.  
  1544. my-new-filter <file >/dev/lp1
  1545.  
  1546. If you want to write a shell script filter it must have a #!/bin/sh
  1547. header.  Here is the generic form of a filter to accept postscript.
  1548.  
  1549. #!/bin/sh
  1550. /path.../gs -q -dSAFER -dNOPAUSE -r??? -sDevice=?????? -sOutputFile=- -
  1551.  
  1552. and place its full pathname as one of the filter (usually `if' but
  1553. _not_ 'of'!) parameter in the printcap for your printer.  I suggest
  1554. putting such scripts in a subdirectory off /usr/lib (sat
  1555. /usr/lib/lpd/). (-dSAFER attempts to protect against ps interpreter
  1556. security holes, -q and -dNOPAUSE make it churn right along quietly,
  1557. and Device is the appropriate driver for your printer).
  1558.  
  1559. Here is an Epson FX-80 dvi filter using ghostscript:
  1560.  
  1561. #!/bin/sh
  1562. /usr/TeX/bin/dvips -f | \
  1563. /usr/bin/gs -q -dSAFER -sDEVICE=eps9high -r120x216 -dNOPAUSE -sOutputFile=- -
  1564.  
  1565. More tools useful for makeing filters are described elsewhere in this
  1566. document.
  1567.  
  1568. ------------------------------
  1569.  
  1570. Subject: A filter tests OK but fails when lpd uses it
  1571. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1572.  
  1573. You may need a #!/bin/sh header. You may also need to set PATH
  1574. within the script since the daemon's PATH may not have everything you
  1575. need.
  1576.  
  1577. ------------------------------
  1578.  
  1579. Subject: `of' filters.
  1580. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1581.  
  1582. Never use these. (Well strictly speaking there are circumstances but
  1583. you're unlikey to meet them).
  1584.  
  1585. ------------------------------
  1586.  
  1587. Subject: Getting filters for given printers
  1588. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1589.  
  1590. >From BSD source archives (I think). [Editors note: I need a
  1591. better answer here ].
  1592.  
  1593. If you already have a program to print say DVI on your printer by some
  1594. mechanism then making it into a filter is usually a matter of writting
  1595. trivial shell script - see this HOWTO. If the program you are using
  1596. insists on reading a names file as input see the next question. Text
  1597. mode filters are trivial too (see this HOWTO) unless you want lpr to
  1598. have a choice of fonts in which case they are slightly harder than
  1599. trivial.  You will probably want to insert and `echo -ne' command at
  1600. the beginning and end of your filter to set up the font etc to your
  1601. liking.
  1602.  
  1603. ------------------------------
  1604.  
  1605. Subject: Filters from programs that won't read STDIN
  1606. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1607.  
  1608. For example dvilj2p insists on a named file as its input (and what's
  1609. more expects one with a .dvi suffix) so do this:
  1610.  
  1611. #!/bin/sh
  1612. ln -s /proc/self/fd/0 /tmp/$$.dvi
  1613. dvilj2p /tmp/$$
  1614. rm /tmp/$$.dvi
  1615.  
  1616. Note: If it wasn't for the fact that dvilj2p adds a .dvi suffix you
  1617. wouldn't need the temporary symlink and could just specify
  1618. /proc/self/fd/0 directly. People who use this trick often usually keep
  1619. permanant symlinks to /proc/self/fd/* in /dev. If you don't have
  1620. procfs you'll need to create a temporary file.
  1621.  
  1622. ------------------------------
  1623.  
  1624. Subject: Having many filters
  1625. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1626.  
  1627. Historically the lpr command was created to support a finite set of
  1628. possible file types. You can, in fact, use any of the filters for any
  1629. reason. If you're never going to use Benson Varian raster files you
  1630. could use the -v switch for GIF files. You could even use -d for low
  1631. res and -v for high res. Remember that if you create a filter for a
  1632. file format that takes a long time to process then your printer may
  1633. sit idle between print jobs even when there are things in the queue.
  1634.  
  1635. If you are on a network remember that the filter setups go on the
  1636. print server.  One way to avoid running out of filter options is to
  1637. define several logical printers in /etc/printcap that all point to the
  1638. same physical one and put each filter in the ``if'' field of a
  1639. different printcap entry. This has the advantage that you can set the
  1640. PRINTER enviroment variable to choose your filter rather than having
  1641. to specify it on the command line each time. One small problem with
  1642. this is that you have no control over the order in which files from
  1643. separate queues are printed.
  1644.  
  1645. Another way to avoid running out of possible types is to use magic
  1646. filters.
  1647.  
  1648. ------------------------------
  1649.  
  1650. Subject: What are magic filters?
  1651. From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1652.  
  1653. Magic filters deduce their input files' types from `magic
  1654. numbers' (distictive byte patterns at particular offsets).  Magic
  1655. filters are usually perl scripts, shell scripts or C programs that
  1656. simply identify the file type then call the appropriate non-magic
  1657. filter. Blatent plug :-) I <B.A.McCauley@bham.ac.uk> have a generic
  1658. magic filter bash script that selects the right filter to use based on
  1659. the output of the `file' command. With my magic ``dvi'' filter (and
  1660. 3 associated non-magic filters) I can do things like:
  1661.  
  1662. lpr -d file1.dvi file2.div.Z file3.ps file4.texinfo.gz
  1663.  
  1664. (BTW confguring lpr to handle texinfo files getting a bit silly - see
  1665. previous question).
  1666.  
  1667. This is now at:
  1668. tsx-11.mit.edu:pub/linux/sources/usr.bin/magic-filter-0.3.tar.gz
  1669. (Although the release number will possibly change in future).
  1670.  
  1671. Magic filters should never specified as `of' as the output filter only
  1672. gets called once if a number of files are printed without a gap.
  1673.  
  1674. IMHO magic filters as `if' can also cause problems as they may prevent
  1675. you, say, _listing_ a PostScript or nroff file. (Other people disagree
  1676. as, if you are making your printer available on a network, it can be a
  1677. pain having people accidently listing ps files.)
  1678. The following is an example of a magic shell script which should take
  1679. either postscript or text and deal with it:
  1680.  
  1681. ------------------------------
  1682.  
  1683. Subject: Magic filter examples
  1684. From: gtaylor@cs.tufts.edu (Grant Taylor)
  1685. Reply-to: B.A.McCauley@bham.ac.uk (Brian McCauley)
  1686.  
  1687. The following is an example of a magic shell script which should take
  1688. either postscript or text and deal with it:
  1689.  
  1690. #!/bin/sh
  1691. # This is based on a script I received from Scott Doty and which was
  1692. # written by Keith Walker.  Keith's script made use of the fact that
  1693. # lpd passes options to if:
  1694. #
  1695. #  <if> -w<width> -l<length> -i<indent> -n <user> -h <host> <accountingfile>
  1696. # to print text out well at any size.  This one does not.  These options
  1697. # are also handy if you want to do your own snazzy header page, much
  1698. # like NeWSPrint from Sun does (although running PostScript through
  1699. # the display server to get it interpreted is a bit much :) 
  1700. #
  1701. # This is untested, but bits of it came from working programs, so it 
  1702. # should work.
  1703. #
  1704. # gs will reset the printer anyway, so the this text setup doesn't matter
  1705. # setup should include the escape code for \n conversion, if applicable
  1706. #
  1707. printf "<printer setup for text printing (escape codes, etc)>"
  1708.  
  1709. read first_line
  1710. first_two_chars=`expr $first_line : '\(..\)'`
  1711.  
  1712. if [ "$first_two_chars" = "%!" ]; then # it's postscript
  1713.  
  1714.         /usr/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=??????? -sOutputFile=- -
  1715.  
  1716. else # it's plain text
  1717.  
  1718.         echo -n $first_line
  1719.         cat
  1720.         printf "\014"
  1721.  
  1722. fi
  1723.  
  1724. Note that for the paranoid, shell scripts run as someone other that
  1725. the user are a security hole, but they are illustrative.
  1726.  
  1727. Even more snazzy things can be done.  The following was the gzip'd,
  1728. uuencoded, C source to a full-featured program which automagically
  1729. recognizes text, dvi, postscript, and direct printer driving (aka
  1730. binary) and does the appropriate thing.  You will have to modify it to
  1731. reflect your printer rather than a LaserJet.  In particular, the
  1732. driver used for gs, and the use of dvips instead of dvilj2p would need
  1733. changing.  This approach also has less overhead as there is not
  1734. another incarnation of bash interpreting it.  This was sent to me by
  1735. Hal Brooks; he wins the award for best print spooler setup from those
  1736. who responded to my survey. :) Note that this program is also
  1737. somewhat in need of a real test, nor does it make any use of the
  1738. arguments passed to `if', but it works for him.
  1739.  
  1740. <This was a tad long; it is available from Grant Taylor's mailserver>
  1741.  
  1742. ------------------------------
  1743.  
  1744. Subject: PREVIEWING          <<<<<<------------
  1745. From: gtaylor@cs.tufts.edu
  1746.  
  1747. These sections describe various ways to preview things under Linux -
  1748. that is, how to view them in a way approximating their final form
  1749. without printing them out.
  1750.  
  1751. ------------------------------
  1752.  
  1753. Subject: ghostview
  1754. From: gtaylor@cs.tufts.edu
  1755.  
  1756. Ghostview, a companion program for gs, previews postscript on an X
  1757. display.  It also lets you select individual or ranges of pages from a
  1758. postscript document to print using lpr.  The new version, 1.5, has
  1759. fixed a few glitches which never bothered me but may make a difference
  1760. to you.  It also calls gs with the -dSAFER option and has a few more
  1761. resource and command-line options relative to 1.4.1.  A binary
  1762. installation of this is probably in the SLS.  The real installation is
  1763. from source
  1764.  
  1765. prep.ai.mit.edu:/pub/gnu/ghostview-xxx.tar.z
  1766.  
  1767. and is a clean build.  Ghostview requires gs to work.  The new version
  1768. of gs, 2.6.x, will use X display fonts in an effort to improve
  1769. legibility at low resolution (a previous failing of this pair relative
  1770. to commercial display-postscript based systems such as Sun's
  1771. pageview).  This works very well for me at least, at the expense of
  1772. exact character positioning (x fonts have different widths).  If you
  1773. prefer exact character representation (within the limits of your
  1774. display), you might wish to let gs render some Type 1 fonts you
  1775. install instead of using platform fonts (or the awful fonts gs comes
  1776. with.  To do this while in ghostview (or in any situation involving
  1777. the X11 driver), place:
  1778.  
  1779. ghostscript.useExternalFonts: false
  1780.  
  1781. in your .Xdefaults file, and the platform fonts will not be used.
  1782.  
  1783. This is part of a message posted to gnu.ghostscript.bug by Tim
  1784. Theisen <ghostview@cs.wisc.edu>:
  1785.  
  1786. (note that the usual Linux X-server, XFree-1.3, does contain a Type 1
  1787. rasterizer which I beleive was contributed by IBM.  I do not know if
  1788. XS3, X8514, or Xega include this.  Look and see :)
  1789.  
  1790. X Resources:
  1791.  
  1792.     Ghostscript now uses the X Toolkit to pick up X Resources.  Now
  1793.     ghostscript uses the standard X rules that allow more specific
  1794.     resources to override less specific ones giving users the full
  1795.     power of X resources to control the X11 driver.  It also allows
  1796.     system administrators to establish an application defaults file
  1797.     with resources specific to their ghostscript installation.
  1798.  
  1799.     The customization choices mentioned in make.doc have been moved into
  1800.     X resources and are now configured at run time rather than compile
  1801.     time.  Sorry, this section of make.doc did not get revised for the
  1802.     2.6.1 release.
  1803.  
  1804.     If useBackingPixmap is set, ghostscript will attempt to allocate
  1805.     a backing pixmap.  If one cannot be allocated, ghostscript will
  1806.     issue a warning and ask for backing store instead.  (Since there
  1807.     were insufficient resources for a backing pixmap, the X server
  1808.     may not provide backing store either.)
  1809.  
  1810.  
  1811. Color Handling:
  1812.  
  1813.     Color Handling was totally revamped for gs 2.6.
  1814.  
  1815.     Ghostscript first checks for a suitable standard colormap.  If you
  1816.     have static colormap in your X server, it would be best to store a
  1817.     standard colormap property on the root window describing the color
  1818.     layout.  Ghostscript will then be able to take full advantage of the
  1819.     device.  If you have a standard colormap installed, ghostscript will
  1820.     start slightly faster since it does not have to allocate colors for
  1821.     a cube or ramp.
  1822.  
  1823.     If no standard colormap is available, ghostscript will allocate an
  1824.     RGB cube or gray ramp.  Ghostscript tries for a 5x5x5 cube on a color
  1825.     device, and a 128 gray ramp on grayscale devices.  It will never ask
  1826.     for more than 1/2 of the colors for a RGB cube or gray ramp.  It also
  1827.     takes into account the number of significant bits per pixel.  (i.e.
  1828.     It won't ask for 128 gray levels if you only have 16 available.)
  1829.  
  1830.     Ghostscript will attempt to allocate colors that are off the color
  1831.     cube/ramp as the picture is being rendered.  Ghostscript will keep
  1832.     track of 256 dynamic colors.  After all these are allocated,
  1833.     ghostscript asks the X server directly.
  1834.  
  1835.     The foreground and background color can be set explicitly.  This
  1836.     is important for the visually impaired and when using the ghostview
  1837.     widget.
  1838.  
  1839.     Color Resources:
  1840.  
  1841.     palette(Palette): Default value: "Color".  Other allowable settings:
  1842.     "Grayscale", "Monochrome".  The palette resource is used to restrict
  1843.     the palette used for display.  One can set palette to "Grayscale" or
  1844.     "Monochrome" to see how a file would be rendered in grayscale or
  1845.     monochrome on a color display.  I use it to avoid dithering of gray-
  1846.     scale figures on a color display with 4-bit DACs.
  1847.  
  1848.     maxGrayRamp(MaxGrayRamp): Default value: 128.  Maximum number of
  1849.     gray levels that ghostscript will attempt to allocate.  (It won't
  1850.     try for more than this on an 8-bit pseudo color display even if you
  1851.     set it higher.)  Set this lower if you want a smaller ramp and
  1852.     would prefer ghostscript to use dynamic colors.
  1853.  
  1854.     maxRGBCube(MaxRGBCube): Default value: 5.  Maximum number of
  1855.     colors levels that ghostscript will attempt to allocate.  (It won't
  1856.     try for more than this on an 8-bit pseudo color display even if you
  1857.     set it higher.)  Set this lower if you want a smaller ramp and
  1858.     would prefer ghostscript to use dynamic colors.
  1859.  
  1860.     I believe these values to be a good compromise between dynamic
  1861.     allocation and fall back onto a fairly good color cube for dithering.
  1862.  
  1863.     You can use the foreground and background colors to accomplish
  1864.     "reverse video".  However, if you have a grayscale device, it may be
  1865.     better to reverse the gray ramp using the following PostScript code
  1866.     fragment:
  1867.  
  1868.     [{1 exch sub} /exec load currenttransfer /exec load] cvx settransfer
  1869.  
  1870.  
  1871. Platform Fonts:
  1872.  
  1873.     The X11 driver now support native X11 fonts.  If you have installed
  1874.     the HP XLFD font extensions into your font or X server.  Ghostscript
  1875.     will also be able to use platform fonts at rotations of 90 degrees,
  1876.     with mirroring, and anamorphic scaling.
  1877.  
  1878.     The X11 driver does most if its work silently.  You can get it to
  1879.     report when it is using an X11 font by setting the logExternalFonts
  1880.     boolean in your X resources.
  1881.  
  1882.     The X11 driver is setup to use the standard fonts distributed with
  1883.     X11R5.  We purchased the Adobe Type Manager and the Adobe Plus Pack.
  1884.     These font packages give all the fonts normally found in the Apple
  1885.     LaserWriter Plus.  The X11 driver is setup to handle these fonts as
  1886.     well.  (They are a superset of the bitmap fonts distributed with X11.)
  1887.  
  1888.     You may set the regularFonts, symbolFonts, or dinbatFonts resources
  1889.     if you have different fonts available.  Each font name must have 7
  1890.     dashes or it will be ignored.  Minimize the use of wildcards to
  1891.     promote faster matching.  (I once encountered an X server that took
  1892.     many seconds to do a font lookup when wildcards were carelessly used.)
  1893.  
  1894.     There is a different list of fonts for each common encoding.  Regular
  1895.     fonts may be accessed in standard or ISO Latin 1 encoding.  The bdf
  1896.     files that are distributed with X11 are in the ISO Latin 1 encoding.
  1897.     This leaves out the ligatures.  Luckily, the ligatures are present in
  1898.     the bdf files, but are not given an encoding, essentially commenting
  1899.     them out.  You can use the fixfont program from the xproof
  1900.     distribution (ftp.cs.wisc.edu:/pub/X/xproof.tar.Z, or
  1901.     ftp.x.org:/contrib/xproof.tar.Z) to reencode the bdf files
  1902.     and build X11 fonts that contain the ligatures (i.e standard encoding).
  1903.  
  1904.     If you have the Type1 fonts mentioned above, and you installed the
  1905.     Type1 rasterizer into you font or X server, you can use the appended
  1906.     fonts.scale to name your fonts so that ghostscript can find them.
  1907.  
  1908.     Font resources:
  1909.  
  1910.     useExternalFonts(UseExternalFonts): Default value: true.
  1911.     This resource controls whether X11 fonts will be used.
  1912.  
  1913.     useScalableFonts(UseScalableFonts): Default value: true.
  1914.     This resource controls whether scalable fonts will be used.
  1915.     If you have an outline scaler in your X server, you should have
  1916.     this on.  If you have an X terminal, you may get slightly better
  1917.     performance with this on.  If you have to use the X11 bitmap scaler,
  1918.     turn this off.  Fonts scaled by the bitmap scaler look worse than
  1919.     the default ghostscript fonts.
  1920.  
  1921.     logExternalFonts(LogExternalFonts): Default value: false.
  1922.     Controls whether to report when X11 fonts are being used.
  1923.  
  1924.  
  1925. The following fonts.scale makes all of the fonts of the Adobe Type Manager
  1926. and Adobe Plus pack available in standard and ISO Latin 1 encoding.
  1927. (We were able to purchase the above two packages at an educational discount
  1928.  price of $150.)
  1929.  
  1930. 70
  1931. agw_____.pfb -Adobe-ITC Avant Garde Gothic-Book-r-normal--0-0-0-0-p-0-iso8859-1
  1932. agwo____.pfb -Adobe-ITC Avant Garde Gothic-Book-o-normal--0-0-0-0-p-0-iso8859-1
  1933. agd_____.pfb -Adobe-ITC Avant Garde Gothic-Demi-r-normal--0-0-0-0-p-0-iso8859-1
  1934. agdo____.pfb -Adobe-ITC Avant Garde Gothic-Demi-o-normal--0-0-0-0-p-0-iso8859-1
  1935. bkl_____.pfb -Adobe-ITC Bookman-Light-r-normal--0-0-0-0-p-0-iso8859-1
  1936. bkli____.pfb -Adobe-ITC Bookman-Light-i-normal--0-0-0-0-p-0-iso8859-1
  1937. bkd_____.pfb -Adobe-ITC Bookman-Demi-r-normal--0-0-0-0-p-0-iso8859-1
  1938. bkdi____.pfb -Adobe-ITC Bookman-Demi-i-normal--0-0-0-0-p-0-iso8859-1
  1939. com_____.pfb -Adobe-Courier-Medium-r-normal--0-0-0-0-m-0-iso8859-1
  1940. coo_____.pfb -Adobe-Courier-Medium-o-normal--0-0-0-0-m-0-iso8859-1
  1941. cob_____.pfb -Adobe-Courier-Bold-r-normal--0-0-0-0-m-0-iso8859-1
  1942. cobo____.pfb -Adobe-Courier-Bold-o-normal--0-0-0-0-m-0-iso8859-1
  1943. hv______.pfb -Adobe-Helvetica-Medium-r-normal--0-0-0-0-p-0-iso8859-1
  1944. hvo_____.pfb -Adobe-Helvetica-Medium-o-normal--0-0-0-0-p-0-iso8859-1
  1945. hvb_____.pfb -Adobe-Helvetica-Bold-r-normal--0-0-0-0-p-0-iso8859-1
  1946. hvbo____.pfb -Adobe-Helvetica-Bold-o-normal--0-0-0-0-p-0-iso8859-1
  1947. hvn_____.pfb -Adobe-Helvetica-Medium-r-Narrow--0-0-0-0-p-0-iso8859-1
  1948. hvno____.pfb -Adobe-Helvetica-Medium-o-Narrow--0-0-0-0-p-0-iso8859-1
  1949. hvnb____.pfb -Adobe-Helvetica-Bold-r-Narrow--0-0-0-0-p-0-iso8859-1
  1950. hvnbo___.pfb -Adobe-Helvetica-Bold-o-Narrow--0-0-0-0-p-0-iso8859-1
  1951. ncr_____.pfb -Adobe-New Century Schoolbook-Medium-r-normal--0-0-0-0-p-0-iso8859-1
  1952. nci_____.pfb -Adobe-New Century Schoolbook-Medium-i-normal--0-0-0-0-p-0-iso8859-1
  1953. ncb_____.pfb -Adobe-New Century Schoolbook-Bold-r-normal--0-0-0-0-p-0-iso8859-1
  1954. ncbi____.pfb -Adobe-New Century Schoolbook-Bold-i-normal--0-0-0-0-p-0-iso8859-1
  1955. por_____.pfb -Adobe-Palatino-Medium-r-normal--0-0-0-0-p-0-iso8859-1
  1956. poi_____.pfb -Adobe-Palatino-Medium-i-normal--0-0-0-0-p-0-iso8859-1
  1957. pob_____.pfb -Adobe-Palatino-Bold-r-normal--0-0-0-0-p-0-iso8859-1
  1958. pobi____.pfb -Adobe-Palatino-Bold-i-normal--0-0-0-0-p-0-iso8859-1
  1959. sy______.pfb -Adobe-Symbol-Medium-r-normal--0-0-0-0-p-0-iso8859-1
  1960. tir_____.pfb -Adobe-Times-Medium-r-normal--0-0-0-0-p-0-iso8859-1
  1961. tii_____.pfb -Adobe-Times-Medium-i-normal--0-0-0-0-p-0-iso8859-1
  1962. tib_____.pfb -Adobe-Times-Bold-r-normal--0-0-0-0-p-0-iso8859-1
  1963. tibi____.pfb -Adobe-Times-Bold-i-normal--0-0-0-0-p-0-iso8859-1
  1964. zcmi____.pfb -Adobe-ITC Zapf Chancery-Medium-i-normal--0-0-0-0-p-0-iso8859-1
  1965. zd______.pfb -Adobe-ITC Zapf Dingbats-Medium-r-normal--0-0-0-0-p-0-iso8859-1
  1966. agw_____.pfb -Adobe-ITC Avant Garde Gothic-Book-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1967. agwo____.pfb -Adobe-ITC Avant Garde Gothic-Book-o-normal--0-0-0-0-p-0-adobe-fontspecific
  1968. agd_____.pfb -Adobe-ITC Avant Garde Gothic-Demi-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1969. agdo____.pfb -Adobe-ITC Avant Garde Gothic-Demi-o-normal--0-0-0-0-p-0-adobe-fontspecific
  1970. bkl_____.pfb -Adobe-ITC Bookman-Light-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1971. bkli____.pfb -Adobe-ITC Bookman-Light-i-normal--0-0-0-0-p-0-adobe-fontspecific
  1972. bkd_____.pfb -Adobe-ITC Bookman-Demi-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1973. bkdi____.pfb -Adobe-ITC Bookman-Demi-i-normal--0-0-0-0-p-0-adobe-fontspecific
  1974. com_____.pfb -Adobe-Courier-Medium-r-normal--0-0-0-0-m-0-adobe-fontspecific
  1975. coo_____.pfb -Adobe-Courier-Medium-o-normal--0-0-0-0-m-0-adobe-fontspecific
  1976. cob_____.pfb -Adobe-Courier-Bold-r-normal--0-0-0-0-m-0-adobe-fontspecific
  1977. cobo____.pfb -Adobe-Courier-Bold-o-normal--0-0-0-0-m-0-adobe-fontspecific
  1978. hv______.pfb -Adobe-Helvetica-Medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1979. hvo_____.pfb -Adobe-Helvetica-Medium-o-normal--0-0-0-0-p-0-adobe-fontspecific
  1980. hvb_____.pfb -Adobe-Helvetica-Bold-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1981. hvbo____.pfb -Adobe-Helvetica-Bold-o-normal--0-0-0-0-p-0-adobe-fontspecific
  1982. hvn_____.pfb -Adobe-Helvetica-Medium-r-Narrow--0-0-0-0-p-0-adobe-fontspecific
  1983. hvno____.pfb -Adobe-Helvetica-Medium-o-Narrow--0-0-0-0-p-0-adobe-fontspecific
  1984. hvnb____.pfb -Adobe-Helvetica-Bold-r-Narrow--0-0-0-0-p-0-adobe-fontspecific
  1985. hvnbo___.pfb -Adobe-Helvetica-Bold-o-Narrow--0-0-0-0-p-0-adobe-fontspecific
  1986. ncr_____.pfb -Adobe-New Century Schoolbook-Medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1987. nci_____.pfb -Adobe-New Century Schoolbook-Medium-i-normal--0-0-0-0-p-0-adobe-fontspecific
  1988. ncb_____.pfb -Adobe-New Century Schoolbook-Bold-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1989. ncbi____.pfb -Adobe-New Century Schoolbook-Bold-i-normal--0-0-0-0-p-0-adobe-fontspecific
  1990. por_____.pfb -Adobe-Palatino-Medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1991. poi_____.pfb -Adobe-Palatino-Medium-i-normal--0-0-0-0-p-0-adobe-fontspecific
  1992. pob_____.pfb -Adobe-Palatino-Bold-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1993. pobi____.pfb -Adobe-Palatino-Bold-i-normal--0-0-0-0-p-0-adobe-fontspecific
  1994. sy______.pfb -Adobe-Symbol-Medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1995. tir_____.pfb -Adobe-Times-Medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1996. tii_____.pfb -Adobe-Times-Medium-i-normal--0-0-0-0-p-0-adobe-fontspecific
  1997. tib_____.pfb -Adobe-Times-Bold-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1998. tibi____.pfb -Adobe-Times-Bold-i-normal--0-0-0-0-p-0-adobe-fontspecific
  1999. zcmi____.pfb -Adobe-ITC Zapf Chancery-Medium-i-normal--0-0-0-0-p-0-adobe-fontspecific
  2000. zd______.pfb -Adobe-ITC Zapf Dingbats-Medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
  2001.  
  2002. ------------------------------
  2003.  
  2004. Subject: gspreview
  2005. From: gtaylor@cs.tufts.edu
  2006.  
  2007. This is another front-end for ghostscript.  I have gotten and built
  2008. it, and actually preferred the user interface, but it had a slight
  2009. glitch which was probably me doing a careless install rather than a
  2010. program bug.  It didn't seem as feature-full as ghostview, though.
  2011. (Not that there are all THAT many features in ghostview, but it does
  2012. its job well)
  2013.  
  2014. ftp.x.org:/contrib/GSPreview...
  2015.  
  2016. ------------------------------
  2017.  
  2018. Subject: xdvi
  2019. From: gtaylor@cs.tufts.edu
  2020.  
  2021. A beautifully legible previewing program for dvi with a handy 
  2022. zoom+pan feature.  Will not interpret ps specials, which are
  2023. understood only by dvips (back to the compiler, object file, and now
  2024. linker analogy :)  To view a file, do:
  2025.  
  2026. xdvi file.dvi
  2027.  
  2028. Mine (from ftp.x.org:/contrib/... ) has the selfile feature,
  2029. where xdvi puts up a file browser... cute but useless.  This comes
  2030. with either TeX or X in the SLS -- I don't remember.  Either way,
  2031. you've probably got one.
  2032.  
  2033. ------------------------------
  2034.  
  2035. Subject: xtex
  2036. From: gtaylor@cs.tufts.edu
  2037.  
  2038. Xtex is similar in purpose to xdvi.  I have tried to build it under
  2039. Linux and failed.  It is available as:
  2040.  
  2041. ftp.x.org:/contrib/xtex-2.18.5.tar.Z
  2042.  
  2043. ------------------------------
  2044.  
  2045. Subject: gxditview
  2046. From: gtaylor@cs.tufts.edu
  2047.  
  2048. Produces a preview version of troff source using X fonts (this means
  2049. it's legible and typeset-looking.)  
  2050.  
  2051. groff -TX100 -mandoc man_page.1
  2052.  
  2053. will run gxditview to show you a typeset version of the man page.
  2054. -TX75 is the same thing, but tiny.  My SLS didn't have a working one
  2055. at all.  A good one comes with the source to groff, which you might
  2056. want to get anyway for the additional drivers (the SLS, until
  2057. recently, was missing several, including postscript).
  2058.  
  2059. prep.ai.mit.edu:/pub/gnu/groff-xxxx.tar.z
  2060.  
  2061. ------------------------------
  2062.  
  2063. Subject: non-x-previewing
  2064. From: gtaylor@cs.tufts.edu
  2065.  
  2066. Gs comes with pc video hardware drivers, but under unix these are not
  2067. a good thing.  However, there are gs binaries around which will use
  2068. the Linux VGA library (vgalib).  I do not know where to find them or
  2069. the patch, but they must be on tsx-11 somewhere.  The ghostscript
  2070. device for this is called linux, thus
  2071.  
  2072. gs -sDEVICE=linux file.ps 
  2073.  
  2074. will show you an image of the Postscript.  The environment variable
  2075. GSVGAMODE is important for this.  Set it to the nuber of the video
  2076. mode you want, taken from the vga.h which comes with vgalib.
  2077.  
  2078. At one point the SLS binaries had this driver, then they didn't, and
  2079. now they do again (I saw an announcement to this effect Aug 14).  (gs
  2080. -help will list the available drivers in your binary.)
  2081.  
  2082. Texmgr is a program which will preview dvi under mgr.  I don't beleive
  2083. that it currently works under Linux MGR, but if it does, MGR uses
  2084. sufficiently less memory and disk that this might be an attractive
  2085. option for some.
  2086.  
  2087. ------------------------------
  2088.  
  2089. Subject: ASCII TRANSLATION   <<<<<<------------
  2090. From: gtaylor@cs.tufts.edu
  2091.  
  2092. These sections describe various programs which can generate plain
  2093. ascii from some file formats.
  2094.  
  2095. ------------------------------
  2096.  
  2097. Subject: from TeX
  2098. From: gtaylor@cs.tufts.edu
  2099.  
  2100. Lametex will generate ascii from tex source.  a beta (?) version is
  2101. now available:
  2102.  
  2103. sunsite.unc.edu:/pub/Linux/apps/tex/lametex.tar.z
  2104.  
  2105. L2a is a program available via FTP which is currently NOT in beta.
  2106. However, as lametex is being tailored to the needs of the Linux
  2107. community in general and the LDP in particular, I feel it is the
  2108. better choice for Linux users.  (But feel free to differ).
  2109.  
  2110. ------------------------------
  2111.  
  2112. Subject: from dvi
  2113. From: gtaylor@cs.tufts.edu
  2114.  
  2115. Dvi2tty is the name of a program which will process dvi into text.
  2116. Aparently, it will also make an effort at reproducing graphics as
  2117. well.
  2118.  
  2119. ------------------------------
  2120.  
  2121. Subject: from ps
  2122. From: gtaylor@cs.tufts.edu
  2123.  
  2124. Ghostscript 2.6.1 comes with a script file which will use gs to
  2125. extract just the text from a ps file, called ps2ascii.  See the gs
  2126. information above for where it can be found.  Further documentation is
  2127. in the ghostscript 2.6.1 distribution files `gs_2asc.ps' and `use.doc'
  2128.  
  2129. ------------------------------
  2130.  
  2131. Subject: from troff
  2132. From: gtaylor@cs.tufts.edu
  2133.  
  2134. groff -Tascii or -Tlatin1.....    
  2135.  
  2136. ------------------------------
  2137.  
  2138. Subject: from ascii/latin1
  2139. From: gtaylor@cs.tufts.edu
  2140.  
  2141. The GNU recode program handles conversion between various forms of
  2142. straight text encoding, ie from Latin-1 to ASCII.  This would be
  2143. available on prep.ai.mit.edu.
  2144.  
  2145. ------------------------------
  2146.  
  2147. Subject: CONTRIBUTORS        <<<<<<------------
  2148. From: gtaylor@cs.tufts.edu
  2149.  
  2150. The following people have offered suggestions, answered surveys,
  2151. provided examples, or otherwise contributed to this document:
  2152.  
  2153. Steven S. Dick
  2154. Ian McCloghrie
  2155. Scott Doty
  2156. Keith Walker
  2157. Werner Almesberger
  2158. Hal N. Brooks
  2159. Kai Makisara
  2160. Kris Gleason
  2161. Savio Lam
  2162. Matthew Ewin Maguire
  2163. James Henrickson
  2164. Telly Mavroidis
  2165. Lloyd Miller
  2166. Richard Brown
  2167. Erik Stenvall
  2168. Ian Turton
  2169. Ian Jackson
  2170. Harri Pasanen
  2171. Nils Rennebarth
  2172. Rusty Carruth
  2173. Martin Neimeier
  2174. Brian McCauley
  2175. Michael K. Johnson
  2176. Erik Stenval
  2177. Fazal Majid
  2178. Tim Thiesen
  2179.  
  2180. --------------------------
  2181. End of digest
  2182. *************
  2183.  
  2184.