home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / linux / howto.printing.part2 < prev    next >
Encoding:
Text File  |  1995-07-25  |  50.4 KB  |  1,136 lines

  1. Subject: Linux Printing HOWTO (part 2/2)
  2. Newsgroups: comp.os.linux.announce,comp.os.linux.admin,comp.answers,news.answers
  3. From: gtaylor@cs.tufts.edu (Grant Taylor)
  4. Date: Fri, 18 Nov 1994 17:29:56 GMT
  5.  
  6. Archive-name: linux/howto/printing/part2
  7. Last-modified: 10 Jul 94
  8.  
  9.  
  10. ---This is part 2/2---
  11.  
  12.    At the time of writing I am quite unable to reproduce this error - I
  13. am using my debugged version of the net-2 lpd compiled with gcc-2.4.5
  14. and libc-4.4.4 on kernel 0.99.14.
  15.  
  16. 3.6 Where Do I Get A Printcap For Printer Model xxxxx?
  17. ======================================================
  18.  
  19.    This question is essentially meaningless so please don't ask it on
  20. usenet See Also: The Semantics of /etc/printcap.
  21.  
  22. 3.7 The Semantics of `/etc/printcap'
  23. ====================================
  24.  
  25.    Given the similarity in appearance and name between `/etc/termcap'
  26. and `/etc/printcap' one could be forgiven for assuming that they
  27. contain analogous infomation. This is not the case. Whereas
  28. `/etc/termcap' contains informations about terminal *types* - (mostly
  29. escape seqences) printcap contains information about *specific*
  30. printers (like the directory that holds the spool queue, the device
  31. name of the printer and what room it's in). The information about a
  32. printer model's escape sequences and so on are held in the various
  33. "filters" which are programs called by `lpd' to drive the printer.
  34. `/etc/printcap' simply gives the locations of these filters.  For
  35. details RTFM(printcap). [Alternatively the net-HOWTO has a summary of
  36. some of the more important fields.]
  37.  
  38.    One last point - you should always specify `suppress header' `:sh:'
  39. unless you have a *text* (not PostScript) printer and want banners. On
  40. a text printer they are usually a waste of time and paper. On a
  41. PostScript printer they usually stop your printer working.  See Also:
  42. Burst/banner pages.
  43.  
  44. 3.8 The Syntax of `/etc/printcap'
  45. =================================
  46.  
  47.    Ideally RTFM(termcap) (yes, I said *termcap*) but since most people
  48. don't have TFM(termcap) here are the essentials.
  49.  
  50.    Lines starting with `#' are comments (as you might have guessed).
  51.  
  52.    For each printer usable from the `lpr' command on your system there
  53. is one logical line in the file. For the sake of readability each
  54. logical line may be spread over several physical lines by making the
  55. last character on all but the last physical line a backslash.
  56.  
  57.    Each logical line has the following format:
  58.  
  59.      NAME1|NAME2|NAME3:STRING_CAPABILITY=STRING:\
  60.             :NUMERIC_CAPABILITY#NUMBER:BOOLEAN_CAPABILITY:
  61.  
  62.    The leading spaces and colon on the second line are for readability
  63. only.
  64.  
  65.    A printer can have as many names as you like but conventionally the
  66. final name is used as a longhand description of the printer. (Still
  67. people are free to say `lpr -P "grotty teletype in room 213"' if that's
  68. the description you've given.) One of the names of your default printer
  69. must be `lp'.
  70.  
  71.    The list of capabilities can be as long as needed and the order is
  72. not significant. Each "capability" is denoted by a two character code.
  73. (The name "capability" comes form the file format's termcap heritage -
  74. parameter or attribute would be a more sensible terms.) [Note from Ross
  75. Biro: capabilities with 3 character names don't work properly which is
  76. why the serial port stuff in the old binaries failed.]  Capabilities
  77. having string value and have a `=' delimiter between the capability
  78. name and the value while those having a numeric value use a `#'
  79. (actually they can use either a `#' or an `='). Boolean "capabilities"
  80. are true if they appear in the list and false if they do not.
  81.  
  82.    Special characters in a string value can be expressed using
  83. backslash-escaped sequences as in C; in addition, `\E' stands for ESC.
  84. `^' is also a kind of escape character; `^' followed by CHAR stands for
  85. the control-equivalent of CHAR.  Thus, `^a' stands for the character
  86. control-a, just like `\001'. `\' and `^' themselves can be represented
  87. as `\\' and `\^' respectively. `\:' for `:' seems to work but the
  88. source code contains a warning that it can confuse the parser and
  89. `\072' is a better idea.
  90.  
  91.    Example:
  92.      lp|bam|Epson FX-80:lp=/dev/lp1:sd=/usr/spool/lp1:sh:mx#0:\
  93.              :df=/usr/local/lib/magic-filter/lp.df:\
  94.              :if=/usr/local/lib/magic-filter/lp.if:
  95.  
  96.    The printer's name is `lp' (this is the printer that `lpr' uses by
  97. default). It's also known as `bam' or `"Epson FX-80"'.
  98.  
  99.    The printer is on `/dev/lp1' (aka AT-bus LPT1:). I don't want a burst
  100. page. I don't want a file length limit. Files queued by `lpr -d' are
  101. passed through `/usr/local/lib/magic-filter/lp.df' and those queued by
  102. `lpr' through `/usr/local/lib/magic-filter/lp.lf'.
  103.  
  104.    See also the next section.
  105.  
  106. 3.9 An `/etc/printcap' gotcha
  107. =============================
  108.  
  109.    Two `/etc/printcap' files can look identical and yet one works and
  110. the other doesn't.
  111.  
  112.    See if `lpc stat' reports a printer called ` :'. The last character
  113. on a continued line must be a backslash. If there are whitespace
  114. characters after the backslash then it doesn't register the next line
  115. as a continuation.
  116.  
  117. 3.10 The Minimum /etc/printcap
  118. ==============================
  119.  
  120.    This is a silly question but it is frequently asked. The answer is
  121. `lp:sh' (that's 6 bytes including the required linefeed character on
  122. the end). To use this `/etc/printcap' you must make `/dev/lp' a symlink
  123. to your printer and create your spool queue directory as
  124. `/usr/spool/lpd'.  (You might think that if you wanted banner pages you
  125. could loose the `:sh' but the termcap syntax requires at least one
  126. capability per entry).
  127.  
  128. 3.11 How to prevent the `Staircase Effect'
  129. ==========================================
  130.  
  131.    Un*x terminates each line of a file with a linefeed but not a
  132. carriage return so taken literally a Un*x text file printed on an ASCII
  133. device will start each line below the end of the previous line.  Some
  134. printers can be set to treat "linefeed" as "carriage return, linefeed",
  135. others can't. If yours can then do simply do that. If the printer
  136. cannot be fixed create a shell script filter that reads:
  137.  
  138.      #!/bin/sh
  139.      if [ "$1" = -c ]; then
  140.        cat
  141.      else
  142.        sed -e s/$/^M/
  143.      fi
  144.      # the ``echo -ne'' assumes that /bin/sh is really bash
  145.      echo -ne \\f
  146.  
  147.    Where `^M' is a carriage return character not a `^' followed by a
  148. `M'.  To type `^M' in Emacs use the sequence `C-q C-m' and in vi use
  149. `C-v C-m'.  Conventionally this script is called `/usr/lib/lpf'. If you
  150. have more than one such script a better idea is to keep them in a
  151. subdirectory, say `/usr/lib/lpd/'. The test of `$1' allows the
  152. insertion of carriage returns to be switched off by `lpr -l'.
  153.  
  154.    Install this filter as the `if' filter by putting
  155. `:if=/usr/lib/lpf:' (or whatever) in your `/etc/printcap' entry for the
  156. printer.
  157.  
  158.    Alternatively your printer may have an escape sequence that will set
  159. the way it handles linefeed characters. A simple filter that uses an
  160. `echo -ne' command to send this sequence may be appropriate.
  161.  
  162.      #!/bin/sh
  163.      # Filter for HP printers to treat LF as CRLF
  164.      # the ``echo -ne'' assumes that /bin/sh is really bash
  165.      echo -ne \\033\&k2G
  166.      cat
  167.      echo -ne \\f
  168.  
  169. 3.12 Resetting the printer between each file printed
  170. ====================================================
  171.  
  172.    Either make your filters do it or define the `tr' "capability" in
  173. `/etc/printcap' to be your printer's font reset command. For details of
  174. the format of this string see the question on the format of printcap.
  175. This may not work if a printout crashes in the middle of an escape
  176. sequence - putting a lot of `^@' on the front may help but this
  177. probably won't be enough it you were printing raster graphics when the
  178. filter died.
  179.  
  180. 3.13 Preventing formfeed after each file printed
  181. ================================================
  182.  
  183.    If you don't have an `if' specified in `/etc/printcap' then `lpd'
  184. will automatically put a formfeed at the end of each file. If you're
  185. using a filter then it's up to the filter to decide if it wants to put
  186. a formfeed. To disable formfeed completely if you don't have an `if'
  187. put `:ff=:' in your `/etc/printcap'.  But please note this suppresses
  188. the formfeed that would usually be printed if a filter dies. If you
  189. want formfeeds after text printouts but not on printouts printed with
  190. `lpr -l' then create the following `if' filter:
  191.  
  192.      #!/bin/sh
  193.      # the ``echo -ne'' assumes that /bin/sh is really bash
  194.      cat
  195.      if [ "$1" != -c ]; then
  196.        echo -ne \\f
  197.      fi
  198.  
  199.    If you want a formfeed after `lpr -l' to be optional you can misuse
  200. the `-i' switch to suppress the formfeed with the following trick (after
  201. all `lpr -i -l' would usually not be implemented).
  202.  
  203.      #!/bin/sh
  204.      cat
  205.      # use lpr -i -l to print raw without trailing formfeed
  206.      if [ "$1" != -c -o "$4" = -i0 ]; then
  207.        # the ``echo -ne'' assumes that /bin/sh is really bash
  208.        echo -ne \\f
  209.      fi
  210.  
  211. 3.14 Printing with lpd to a serial port
  212. =======================================
  213.  
  214.    The first if lpd complains about "ioctl(TIOCEXCL)" being
  215. unimplemented you need a version of lpd that doesn't care (eg.
  216. lpd-590p2)
  217.  
  218.    There are two sets of flags which you will need to set, plus the baud
  219. rate (Note: the `fc' flag setting seems to override the `br#'
  220. capability, so be sure to set that correctly as well as the `br#'!).
  221.  
  222.    Each of the flags can have bits set and cleared. Clearing is done
  223. first, so specify the clear flags (`fc#' and `xc#') before the set
  224. flags (`fs' and `xs').
  225.  
  226.    Setting the `br#' capability is self-explanatory. Example: `br#9600'
  227.  
  228.    It is very easy to translate from `stty' settings to printcap flag
  229. settings. If you need to, see the man page for stty now.
  230.  
  231.    Use stty to set up the printer port so that you can cat a file to it
  232. and have it print correctly. Here's what `stty -a' looks like for my
  233. printer port:
  234.  
  235.      dina:/usr/users/andy/work/lpd/lpd# stty -a < /dev/ttyS2
  236.      speed 9600 baud; rows 0; columns 0; line = 0;
  237.      intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
  238.      eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
  239.      lnext = ^V; min = 1; time = 0;
  240.      -parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
  241.      -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr
  242.      -igncr -icrnl ixon -ixoff -iuclc -ixany -imaxbel
  243.      -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0
  244.      bs0 vt0 ff0
  245.      -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop
  246.      -echoprt -echoctl -echoke
  247.  
  248.    The only changes between this and the way the port is initialized at
  249. bootup are `-clocal', `-crtscts', and `ixon'. Your port may well be
  250. different depending on how your printer does flow control.
  251.  
  252.    Once you have your stty settings right, so that `cat file >
  253. /dev/ttyS2' (in my case) sends the file to the printer, look at the file
  254. `/usr/src/linux/include/linux/termios.h'. This contains a lot of
  255. `#define's and a few structs (You may wish to cat this file to the
  256. printer (you do have that working, right?) and use it as scratch paper
  257. - I (Andrew Tefft <teffta@engr.dnet.ge.com> did!). Go to the section
  258. that starts out
  259.  
  260.      /* c_cflag bit meaning */
  261.      #define CBAUD   0000017
  262.  
  263.    This section lists the meaning of the `fc#' and `fs#' bits.  You
  264. will notice that the names there (after the baud rates) match up with
  265. one of the lines of stty output. Didn't I say this was going to be easy?
  266.  
  267.    Note which of those settings are preceded with a - in your stty
  268. output. Sum up all those numbers (they are octal). This represents the
  269. bits you want to *clear*, so the result is your `fc#' capability.  Of
  270. course, remember that you will be setting bits directly after you
  271. clear, so you can just use `fc#0177777' (I do).
  272.  
  273.    Now do the same for those settings (listed in this section) which do
  274. not have a - before them in your stty output. In my example the
  275. important ones are CS8 (0000060), HUPCL (0002000), and CREAD (0000200).
  276. Also note the flags for your baud rate - mine is 0000015. Add those all
  277. up, and in my example you get 0002275. This goes in your `fs#'
  278. capability (`fs#02275' works fine in my example).
  279.  
  280.    Do the same with set and clear for the next section of the include
  281. file, "c_lflag bits". In my case I didn't have to set anything, so I
  282. just use `xc#0157777' and `xs#0'.
  283.  
  284.    Once your printcap is set up, try it out. If things don't work, see
  285. the next section.
  286.  
  287. 3.15 cat works to the serial port, but not lpd (1)
  288. ==================================================
  289.  
  290.    Generally getting lpd up and running is explained elsewhere, but if
  291. you are having trouble with serial port settings you can prevent `lpd'
  292. from trying to configure your port by treating you printer as one that
  293. does not present a normal device interface. See Also: Printers not in
  294. /dev.
  295.  
  296.   1. Set your printer (in your printcap) to `/dev/null1'. (`mknod
  297.      /dev/null1 c 1 3' because you don't want `/dev/null' to be opened
  298.      exclusively).
  299.  
  300.      remove the baud rate and flags settings from your printcap.
  301.  
  302.   2. Create a script such as this:
  303.  
  304.           #!/bin/sh
  305.           echo if: $* >> /var/spool/lpd/results
  306.           # /dev/lp is linked to /dev/ttyS2 which has the printer
  307.           exec your-old-input-filter $* > /dev/lp
  308.         ...or if you didn't have an old `if' installed...
  309.           #!/bin/sh
  310.           echo if: $* >> /var/spool/lpd/results
  311.           cat > /dev/lp
  312.           # the ``echo -ne'' assumes that /bin/sh is realy bash
  313.           echo -en \\f > /dev/lp
  314.  
  315.      Make sure it's world-executable and world-readable. Try out your
  316.      script (`/usr/lib/lpd/if < SOMEFILE') and see if it prints.
  317.  
  318.   3. Set the `if' capability in your printcap to call this script, e.g.
  319.      `if=/usr/lib/lpd/if'
  320.  
  321.   4. Use stty to correctly set your port settings. Try to print now.
  322.      You should be able to tell if things are being spooled, and things
  323.      *should* be printed, if your manual testing of the `if' script
  324.      works. But this is a kludge, so the idea is not to use the `if'
  325.      script.
  326.  
  327.    Assuming the above method using the `if' filter works and that you
  328. believe that you have specified what you think are the correct flags
  329. and baud rate in printcap; check `stty -a < /dev/ttyS2' (or whatever
  330. your printer port is).  If the settings are not correct, check your
  331. flags against your printout from termios.h. If the settings are *way*
  332. not correct, you may need a fixed lpd. The patch follows, and you can
  333. probably see why it's needed :-) Note: this patch is reversed and has
  334. already been applied (uh... unapplied :-) ) to lpd-590p2 so don't apply
  335. it if you already have that version or later.
  336.  
  337.    (the patch is coming in just a sec)
  338.  
  339.    When I was setting mine up, I followed a sequence like this:
  340.  
  341.      lprm WHATEVER # (make sure queue is empty and lpd is running)
  342.      stty CORRECT SETTINGS < /dev/ttyS2
  343.      lpr SOMETHING SMALL
  344.      stty -a < /dev/ttyS2  # (often had to ctrl-c out of this one)
  345.      
  346.      twiddle with flags
  347.      
  348.      lprm WHATEVER # make sure queue is empty again...
  349.  
  350.    Here's the patch (I it's reversed so apply it with `-R' - or, in
  351. practice, by hand!):
  352.  
  353.      -------------------------------Cut Here-------------------------------------
  354.      *** lpd-590/lpd/printjob.c  Thu Jul  8 20:56:59 1993
  355.      --- lpd-590/lpd/printjob.c~ Sat Feb 27 09:07:01 1993
  356.      ***************
  357.      *** 1271,1277 ****
  358.              }
  359.        #ifdef LINUX
  360.              ttybuf.c_cflag &= ~FC;          /* not quite right! */
  361.      !       ttybuf.c_cflag |= FS;           /* not quite right! */
  362.        #else
  363.              ttybuf.sg_flags &= ~FC;
  364.              ttybuf.sg_flags |= FS;
  365.      --- 1271,1277 ----
  366.              }
  367.        #ifdef LINUX
  368.              ttybuf.c_cflag &= ~FC;          /* not quite right! */
  369.      !       ttybuf.c_cflag |= ~FS;          /* not quite right! */
  370.        #else
  371.              ttybuf.sg_flags &= ~FC;
  372.              ttybuf.sg_flags |= FS;
  373.      -------------------------------Cut Here-------------------------------------
  374.  
  375. 3.16 Printers that are not simple devices
  376. =========================================
  377.  
  378.    [Firstly I'll explain the subject.] The most common example is a
  379. printer that is connected via a network in some strange way.  For
  380. example consider a printer connected to a host with which you can only
  381. communicate via E-mail.
  382.  
  383.    To use such a printer through `lpr' the `lp' capability of the print
  384. queue should be directed to a `/dev/null' type device (e.g. `mknod
  385. /dev/null1 c 1 3') but not `/dev/null' itself as `lpd' opens the device
  386. exclusively. Each filter must must explicitly uuencode and mail its
  387. output.
  388.  
  389.    In more complex cases if you already have an `if' or `of' filter for
  390. a strangely connected printer then other filters can pass their output
  391. to/through this filter to avoid duplication of effort.  In this case
  392. the `if' filter should usually be called with the `-c' switch to
  393. minimise the further manipulations if performs.
  394.  
  395.    I've heard someone has had some success trying something like this
  396. with Novell NetWare and the free mail transfer agent "Charon".
  397.  
  398. 3.17 Generating burst or banner pages
  399. =====================================
  400.  
  401.    For a simple text printer (in particular not PostScript) and a
  402. simple text banner simply take `:sh:' out of the printcap record. If you
  403. want to prevent the banner comming out in whatever font was last used
  404. on the printer then define the `tr' "capability" to be your printer's
  405. font reset command.
  406.  
  407.    If you want a fancy customised banner (or have a PostScript printer)
  408. leave `:sh:' in the printcap and make each of your filters print the
  409. banner. All the information to put on the banner is included in the
  410. filter's positional parameters.  RTFM(printcap) for details. [ If
  411. you're using <B.A.McCauley@bham.ac.uk>'s magic-filter package then call
  412. the code to print the banners from the config script. ]
  413.  
  414. 3.18 Spooling text to a PostScript printer
  415. ==========================================
  416.  
  417.    You need a filter based on a program that converts ascii to
  418. PostScript. The most well known of these is `enscript' but it's also
  419. the hardest to find (being non-free). Others include `a2ps',
  420. `nenscript', and `mpage'. See Also: Printing text via PostScript.
  421.  
  422. 3.19 Why graphics files are sometines truncated
  423. ===============================================
  424.  
  425.    This is usually because you've got a limit set on the maximum size
  426. file that can sit in the spool queue. Put `mx#0' in your printcap.
  427.  
  428. 3.20 Why `lpr -i' doesn't work
  429. ==============================
  430.  
  431.    To get `lpr -i' to work you need a filter installed as `if' that
  432. implements it.  The `-i' switch is simply passed on by `lpd' to the
  433. filter.  The filter called `lpf' that comes with `lpd' supports this
  434. feature but can only be used to print text.  If you whant to use this
  435. program but still want your filter to do some printer specific
  436. initialisation then write script thus:
  437.  
  438.      #!/bin/sh
  439.      # My initialisation stuff goes here
  440.      exec /usr/lib/lpf $*
  441.  
  442.    More reasonably you could have your filter script send the printer
  443. left margin sequence.
  444.  
  445.      #!/usr/bin/perl
  446.      # This example is in perl for a change because converting numbers
  447.      # to characters is tricky in shell script
  448.      
  449.      for ($i=0; !($_ = $ARGV[$i]) || !/^-i([0-9])+/; $i++) {}
  450.      
  451.      print pack("cAc",27,"l",$1);
  452.      
  453.      while (<STDIN>) { print; }
  454.  
  455. 3.21 Why `lpr -p' doesn't work?
  456. ===============================
  457.  
  458.    Because it's broken. `lpd' always thinks that the printer is 0
  459. characters wide regardless of what `/etc/printcap' or the `lpr'
  460. arguemnts say. The lpd-FAQ contained a patch but it has now been
  461. applied to lpd-590p1 and later. (Appologies to anyone who wanted this
  462. patch after the lpd-FAQ merged with printing-how.to. It was dropped in
  463. the mistaken belief that a new release of lpd-590 was iminent).
  464.  
  465.    One other thing: `lpd' calls `pr' by full pathname so if you keep
  466. `pr' somewhere different from `/usr/bin/pr' you will need a symlink.
  467. (Where `lpd' expects to find `pr' may vary from version to version).
  468.  
  469. 3.22 `lpc' and `lpq' warning of missing daemons
  470. ===============================================
  471.  
  472.    One `lpd' process runs all the time and it spawns children to handle
  473. each printer as needed. The health of the master daemon is not
  474. explicity reported by `lpc' but the absence of errors indicates that it
  475. is healthy. See Also: lpd not working. The `lpc stat' command will
  476. display the message "no daemon present" for each queue that is not
  477. actually printing at the time - this is completely normal. If printing
  478. has been disabled or the queue is empty then this is not an error
  479. condition. `lpq' is even more alarmist and will say "Warning: no daemon
  480. present". If the daemon is absent when the queue has entries and has
  481. not been explicitly stopped then this warning probably indicates an
  482. error in a filter. Fix the filter then use `lpd up QUEUE-NAME' to
  483. restart it.
  484.  
  485.    Sometimes when shutting down a printer `lpc' will get confused and
  486. try to kill a non existant daemon. This leads to irritating but harmless
  487. error messages. In lpd-590p2 these are much rarer.
  488.  
  489. 3.23 Using `lpr' over a network
  490. ===============================
  491.  
  492.    To print on the printer listed as `foo' in the printcap on machine
  493. `bar.baz.net' from the machine `mine.baz.net' you put an entry like
  494. this in your `/etc/printcap' (on `mine.baz.net'):
  495.  
  496.      foo:lp=:rm=bar.baz.net:rp=foo:sd=/usr/lpd/spool/foo:
  497.  
  498.    and, of course, create the spool directory `/usr/lpd/spool/foo'.
  499.  
  500.    There's no point specifying filters and the like in
  501. `mine.baz.net:/etc/printcap' as it's the ones in
  502. `bar.baz.net:/etc/printcap' that will get used.
  503.  
  504.    On the machine `bar.baz.foo', you need to put `mine.baz.net' on a
  505. line by itself in either `/etc/hosts.equiv' or `/etc/hosts.lpd'; note
  506. that putting it in `/etc/hosts.equiv' will allow for unauthenticated
  507. logins as well as printing.  `/etc/hosts.lpd' is for printing only.
  508.  
  509.    The machines listed in `/etc/hosts.*' should be described canonical
  510. names or numbers as lpd starts with the IP address and performs a
  511. revervse DNS lookup to get the name. If you are not sure of cannonical
  512. name you can just list all the names you know for a machine. (If you
  513. have `dig' then the command `dig -x A.B.C.D' can be used to get the
  514. canonical name of IP address A.B.C.D.)
  515.  
  516.    If the printer server is not nunning a BSD style spooler then it
  517. should still be possible to get it to work but the authority files may
  518. have a different names or formats. For example Chris Nystrom
  519. <chrisn@medianet.com> found that he had to create a file on the remote
  520. machine called `/usr/spool/lp/admins/lp/Systems' that listed his Linux
  521. box's name. We do not know if this is a SYSV thing or something
  522. exclusive to dynix/ptx 2.0.3 that he is using on his Sequent.
  523.  
  524.    If you can't get remote printing to work thrugh lpd you may be able
  525. to simply use remote command exectution like this:
  526.  
  527.      rsh bar.baz.net "lp -dlp" < FILE
  528.  
  529.    This example would be for a remote system using a SYSV type printing
  530. system on host `bar.baz.net'.
  531.  
  532. 3.24 Writing lpd filters
  533. ========================
  534.  
  535.    In normal Un*x terminology, filters are just programs (so they must
  536. have execute permission) that read a stream from their standard input
  537. and write to their standard output.
  538.  
  539.    lpd filters are filters in the sense that thay read STDIN and write
  540. to STDOUT, but are unusual in that they may assume that their standard
  541. input is a random acess file file and may perform lseek() operations on
  542. it.
  543.  
  544.    All lpd filters have a common command line syntax (or more often
  545. simply ignore command line parameters). For details of the command line
  546. parameters RTFM(printcap).
  547.  
  548.    If you want to write a shell script filter it must have a #!/bin/sh
  549. (or perl or csh) header.  Here is the generic form of a filter to
  550. accept PostScript.
  551.  
  552.      #!/bin/sh
  553.      /PATH.../gs -q -dSAFER -dNOPAUSE -r??? -sDevice=?????? -sOutputFile=- -
  554.  
  555.    Place the full pathname of the script as one of the filters (but not
  556. `of'!) parameter in the printcap for your printer.  I suggest putting
  557. such scripts in `/usr/lib/lpd/'. It is also usual to keep filters in
  558. the spool directories but this goes against normal practice of keeping
  559. programs and data neatly apart.  (`-dSAFER' attempts to protect against
  560. PostScript interpreter security holes, `-q' and `-dNOPAUSE' make it run
  561. nonstop, and Device is the appropriate special file for your printer).
  562.  
  563.    Here is an Epson FX-80 dvi filter using ghostscript:
  564.  
  565.      #!/bin/sh
  566.      /usr/TeX/bin/dvips -f | \
  567.                    /usr/bin/gs -q -dSAFER -sDEVICE=eps9high -r120x216 \
  568.                    -dNOPAUSE -sOutputFile=- -
  569.  
  570.    More tools useful for making filters are described elsewhere in this
  571. document.
  572.  
  573. 3.25 Debuging lpd filters
  574. =========================
  575.  
  576.    It's easier to debug filters if you test them in an immediate shell
  577. before you install them. (If your filter makes use of its command line
  578. arguments you'll have to specify them too).  `my-new-filter <FILE
  579. >/dev/lp1'
  580.  
  581.    A trick most people find useful when testing filters that make use of
  582. their command line arguments is to include `echo $* >>/tmp/filter-log'
  583. near the top of the script.
  584.  
  585.    If the filter works when you test it but still doesn't work when
  586. called by `lpd' then you may have forgotten the `#!/bin/sh' header. You
  587. may also need to set PATH within the script since the daemon's PATH may
  588. not have everything you need. Note also that the filter is run with
  589. uid=daemon so any programs it calls sould be world executable.
  590.  
  591. 3.26 Output (`of') filters
  592. ==========================
  593.  
  594.    Never use these. (Well strictly speaking there are circumstances but
  595. you're unlikey to meet them). Recently (early '94) there has been a
  596. spate of preople on c.o.l.help advokating the use of output filters.
  597. Using `of' filters means that if a printout is queued while another is
  598. already printing the 2 will be run together with a form-feed between.
  599. Any printer initialisation or file type detection will therfore not be
  600. performed for the second file and it will probably be printed
  601. incorrectly. There are other more subtle ways in which output filters
  602. can do unexpected things. IMHO: If using an output filter is the
  603. answer, it was probably a silly question.
  604.  
  605. This is Info file Printing-HOWTO.info, produced by Makeinfo-1.55 from
  606. the input file printing.texinfo.
  607.  
  608.    A guide to printing and previewing files under the Linux operating
  609. system.
  610.  
  611.    Copyright (C) 1994 by Grant Taylor and Brian McCauley
  612.  
  613. 3.27 Getting filters for given printers
  614. =======================================
  615.  
  616.    From: B.A.McCauley@bham.ac.uk (Brian McCauley)
  617.  
  618.    Because writing a filter usually takes about 10 minutes once you've
  619. found the right program (`gs', `dvilj' etc.) there's little call for
  620. ftp archives of printer filters but we are thinking of creating an
  621. extensive example file to go with this document.
  622.  
  623.    If you already have a program to print, say, DVI on your printer by
  624. some mechanism then making it into a filter is usually a matter of
  625. writting trivial shell script See Also: Writing lpd filters. If the
  626. program you are using insists on reading a names file as input see the
  627. next question. Text mode filters are trivial too (see this HOWTO)
  628. unless you want lpr to have a choice of fonts in which case they are
  629. slightly harder than trivial.  You will probably want to insert and
  630. `echo -ne' command at the beginning and end of your filter to set up
  631. the font etc to your liking.
  632.  
  633. 3.28 Filters from programs that won't read STDIN
  634. ================================================
  635.  
  636.    Some of the programs that are used in writing `lpd' filters are not
  637. capable of taking their input from their standard input. For example
  638. `dvilj2p' insists on a named file as its input (and what's more expects
  639. one with a `.dvi' suffix) so do this:
  640.  
  641.      #!/bin/sh
  642.      ln -s /proc/self/fd/0 /tmp/$$.dvi
  643.      dvilj2p /tmp/$$
  644.      rm /tmp/$$.dvi
  645.  
  646.    Note: If it wasn't for the fact that `dvilj2p' adds a `.dvi' suffix
  647. you wouldn't need the temporary symlink and could just specify
  648. `/proc/self/fd/0' directly. People who use this trick often usually
  649. permanently `ln -s /proc/self/fd/0 /dev/stdin'. If you're highly
  650. security concious and don't allow access to `/proc' you'll need to
  651. create a temporary file.
  652.  
  653. 3.29 Having many filters
  654. ========================
  655.  
  656.    Historically the `lpr' command was created to support a finite set
  657. of possible file types. You can, in fact, use any of the filters for any
  658. reason. If you're never going to use Benson Varian raster files you
  659. could use the `-v' switch for GIF files. You could even use `-d' for
  660. low res and `-v' for high res. Remember that if you create a filter for
  661. a file format that takes a long time to process then your printer may
  662. sit idle between print jobs even when there are things in the queue.
  663.  
  664.    If you are on a network remember that the filter setups go on the
  665. print server.  One way to avoid running out of filter options is to
  666. define several logical printers in `/etc/printcap' that all point to the
  667. same physical one and put each filter in the `if' field of a different
  668. printcap entry. This has the advantage that you can set the `PRINTER'
  669. enviroment variable to choose your filter rather than having to specify
  670. it on the command line each time. One small problem with this is that
  671. you have no control over the order in which files from separate queues
  672. are printed.
  673.  
  674.    Another (and these days more common) way to avoid running out of
  675. possible types is to use magic filters.
  676.  
  677. 3.30 Magic Filters
  678. ==================
  679.  
  680.    Magic filters deduce their input files' types from `magic numbers'
  681. (distictive byte patterns at particular offsets).  Magic filters are
  682. usually perl scripts, shell scripts or C programs that simply identify
  683. the file type then call the appropriate non-magic filter. Blatent plug
  684. :-) Brian has a generic magic filter bash script that selects the right
  685. filter to use based on the output of the `file' command. With a
  686. suitable magic filter (and 3 associated non-magic filters) you can do
  687. things like:
  688.  
  689.      lpr -d file1.dvi file2.div.Z file3.ps file4.texinfo.gz
  690.  
  691.    (BTW confguring `lpr' to handle texinfo files is getting a bit
  692. silly).
  693.  
  694.    This is now on the mailserver or at:
  695. `tsx-11.mit.edu:pub/linux/sources/usr.bin/magic-filter-0.4.tar.gz'
  696. (Although the release number will possibly change in future).
  697.  
  698.    `apsfilter' is a rather easier to use shell script that requires no
  699. additional filters and which is pre-configured for HP compatible laser
  700. printers. This is also available on the mailserver.
  701.  
  702.    An example written in C, which may be easily adapted to most
  703. installations is available from the printing mail server as `lpr_if.c'.
  704.  
  705.    Magic filters should never specified as `of' as the output filter
  706. only gets called once if a number of files are printed without a gap.
  707. There are other more subtle problems too using `of'.
  708.  
  709.    IMHO (Brian) magic filters as `if' are inelegant as they may prevent
  710. you, say, listing a PostScript or nroff file. (Most people disagree
  711. with me on this point.)
  712.  
  713. 3.31 Magic Filter Examples
  714. ==========================
  715.  
  716.    The following is an example of a magic shell script which should take
  717. either PostScript or text and deal with it:
  718.  
  719.      #!/bin/sh
  720.      # This is based on a script I received from Scott Doty and which was
  721.      # written by Keith Walker.  Keith's script made use of the fact that
  722.      # lpd passes options to if:
  723.      #
  724.      #  <if> -w<width> -l<length> -i<indent> -n <user> -h <host> <accountingfile>
  725.      #
  726.      # to print text out well at any size.  This one does not.  These options
  727.      # are also handy if you want to do your own snazzy header page, much
  728.      # like NeWSPrint from Sun does (although running PostScript through
  729.      # the display server to get it interpreted is a bit much :)
  730.      #
  731.      #
  732.      # gs will reset the printer anyway, so the this text setup doesn't matter.
  733.      # setup should include the escape code for \n conversion, if applicable.
  734.      #
  735.      printf "<printer setup for text printing (escape codes, etc)>"
  736.      
  737.      read first_line
  738.      first_two_chars=`expr $first_line : '\(..\)'`
  739.      
  740.      if [ "$first_two_chars" = "%!" ]; then # it's PostScript
  741.      
  742.              /usr/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=??????? -sOutputFile=- -
  743.      
  744.      else # it's plain text
  745.      
  746.              echo -n $first_line
  747.              cat
  748.              printf "\014"
  749.      
  750.      fi
  751.  
  752.    Note that for the paranoid, shell scripts run as someone other than
  753. the user are sometimes a security hole, but this is not the case with
  754. lpd filters as the script's environment is not under the control of the
  755. potential cracker.
  756.  
  757. 4 Previewing
  758. ************
  759.  
  760.    These sections describe various ways to preview things under Linux -
  761. that is, how to view them in a way approximating their final form
  762. without printing them out.
  763.  
  764. 4.1 ghostview
  765. =============
  766.  
  767.    Ghostview, a companion program for `gs', previews PostScript on an X
  768. display.  It also lets you select individual or ranges of pages from a
  769. PostScript document to print using `lpr'.  The new version, 1.5, has
  770. fixed a few glitches which never bothered me but may make a difference
  771. to you.  It also calls `gs' with the `-dSAFER' option and has a few
  772. more resource and command-line options relative to 1.4.1.  The real
  773. installation is from:
  774. `prep.ai.mit.edu:/pub/gnu/ghostview-XXX.tar.gz'
  775.  
  776.    It builds out of the box.  Ghostview requires `gs' to work.  The new
  777. version of `gs', 2.6.x, will use X display fonts in an effort to
  778. improve legibility at the low resolutions of a video monitor (a
  779. previous failing of this pair relative to commercial display-PostScript
  780. based systems).  This works very well for me at least, at the expense
  781. of exact character positioning (X fonts have different widths).  In
  782. fact, I thought that Ghostview looks better than Sun's pageview the
  783. other day when I looked at the same page in oth programs side-by-side.
  784. Ghostview/Ghostscript also has much more intelligent color handling
  785. than pageview.  You might wish to let `gs' render some Type 1 fonts you
  786. install instead of using platform fonts (or the awful fonts `gs' comes
  787. with.  To do this while in Ghostview (or in any situation involving the
  788. X11 driver), place `ghostscript.useExternalFonts: false' in your
  789. `.Xdefaults' file, and the platform fonts will not be used.
  790.  
  791.    This is part of a message posted to gnu.ghostscript.bug by Tim
  792. Theisen <ghostview@cs.wisc.edu>:
  793.      (note that the usual Linux X-server, XFree, is simply an enhanced
  794.      version of MIT's effort at an i386 X-server (X386), and does
  795.      contain the X11R5 Type 1 rasterizer which I beleive was
  796.      contributed by IBM.)
  797.  
  798.      Ghostscript now uses the X Toolkit to pick up X Resources.  Now
  799.      ghostscript uses the standard X rules that allow more specific
  800.      resources to override less specific ones giving users the full
  801.      power of X resources to control the X11 driver.  It also allows
  802.      system administrators to establish an application defaults file
  803.      with resources specific to their ghostscript installation.
  804.  
  805.      The customization choices mentioned in make.doc have been moved
  806.      into X resources and are now configured at run time rather than
  807.      compile time.  Sorry, this section of make.doc did not get revised
  808.      for the 2.6.1 release.
  809.  
  810.      If `useBackingPixmap' is set, ghostscript will attempt to allocate
  811.      a backing pixmap.  If one cannot be allocated, ghostscript will
  812.      issue a warning and ask for backing store instead.  (Since there
  813.      were insufficient resources for a backing pixmap, the X server may
  814.      not provide backing store either.)
  815.  
  816.      Color Handling was totally revamped for gs 2.6.
  817.  
  818.      Ghostscript first checks for a suitable standard colormap.  If you
  819.      have static colormap in your X server, it would be best to store a
  820.      standard colormap property on the root window describing the color
  821.      layout.  Ghostscript will then be able to take full advantage of
  822.      the device.  If you have a standard colormap installed,
  823.      ghostscript will start slightly faster since it does not have to
  824.      allocate colors for a cube or ramp.
  825.  
  826.      If no standard colormap is available, ghostscript will allocate an
  827.      RGB cube or gray ramp.  Ghostscript tries for a 5x5x5 cube on a
  828.      color device, and a 128 gray ramp on grayscale devices.  It will
  829.      never ask for more than 1/2 of the colors for a RGB cube or gray
  830.      ramp.  It also takes into account the number of significant bits
  831.      per pixel.  (i.e.  It won't ask for 128 gray levels if you only
  832.      have 16 available.)
  833.  
  834.      Ghostscript will attempt to allocate colors that are off the color
  835.      cube/ramp as the picture is being rendered.  Ghostscript will keep
  836.      track of 256 dynamic colors.  After all these are allocated,
  837.      ghostscript asks the X server directly.
  838.  
  839.      The foreground and background color can be set explicitly.  This
  840.      is important for the visually impaired and when using the ghostview
  841.      widget.
  842.  
  843.      Color Resources:
  844.  
  845.        1. `palette'(`Palette'): Default value: `Color'.  Other
  846.           allowable settings: `Grayscale', `Monochrome'.  The palette
  847.           resource is used to restrict the palette used for display.
  848.           One can set palette to `Grayscale' or `Monochrome' to see how
  849.           a file would be rendered in grayscale or monochrome on a
  850.           color display.  I use it to avoid dithering of gray- scale
  851.           figures on a color display with 4-bit DACs.
  852.  
  853.        2. `maxGrayRamp'(`MaxGrayRamp'): Default value: 128.  Maximum
  854.           number of gray levels that ghostscript will attempt to
  855.           allocate.  (It won't try for more than this on an 8-bit
  856.           pseudo color display even if you set it higher.)  Set this
  857.           lower if you want a smaller ramp and would prefer ghostscript
  858.           to use dynamic colors.
  859.  
  860.        3. `maxRGBCube'(`MaxRGBCube'): Default value: 5.  Maximum number
  861.           of colors levels that ghostscript will attempt to allocate.
  862.           (It won't try for more than this on an 8-bit pseudo color
  863.           display even if you set it higher.)  Set this lower if you
  864.           want a smaller ramp and would prefer ghostscript to use
  865.           dynamic colors.
  866.  
  867.      I believe these values to be a good compromise between dynamic
  868.      allocation and fall back onto a fairly good color cube for
  869.      dithering.
  870.  
  871.      You can use the foreground and background colors to accomplish
  872.      "reverse video".  However, if you have a grayscale device, it may
  873.      be better to reverse the gray ramp using the following PostScript
  874.      code fragment:
  875.  
  876.           [{1 exch sub} /exec load currenttransfer /exec load] cvx settransfer
  877.  
  878.      The X11 driver now supports native X11 fonts.  If you have
  879.      installed the HP XLFD font extensions into your font or X server.
  880.      Ghostscript will also be able to use platform fonts at rotations
  881.      of 90 degrees, with mirroring, and anamorphic scaling.
  882.  
  883.      The X11 driver does most if its work silently.  You can get it to
  884.      report when it is using an X11 font by setting the logExternalFonts
  885.      boolean in your X resources.
  886.  
  887.      The X11 driver is setup to use the standard fonts distributed with
  888.      X11R5.  We purchased the Adobe Type Manager and the Adobe Plus
  889.      Pack.  These font packages give all the fonts normally found in
  890.      the Apple LaserWriter Plus.  The X11 driver is setup to handle
  891.      these fonts as well.  (They are a superset of the bitmap fonts
  892.      distributed with X11.)
  893.  
  894.      You may set the regularFonts, symbolFonts, or dinbatFonts resources
  895.      if you have different fonts available.  Each font name must have 7
  896.      dashes or it will be ignored.  Minimize the use of wildcards to
  897.      promote faster matching.  (I once encountered an X server that took
  898.      many seconds to do a font lookup when wildcards were carelessly
  899.      used.)
  900.  
  901.      There is a different list of fonts for each common encoding.
  902.      Regular fonts may be accessed in standard or ISO Latin 1 encoding.
  903.      The bdf files that are distributed with X11 are in the ISO Latin
  904.      1 encoding.  This leaves out the ligatures.  Luckily, the
  905.      ligatures are present in the bdf files, but are not given an
  906.      encoding, essentially commenting them out.  You can use the
  907.      `fixfont' program from the xproof distribution
  908.      (`Ftp.Cs.Wisc.Edu:/Pub/X/Xproof.Tar.Z', or
  909.      `Ftp.X.Org:/Contrib/Xproof.Tar.Z') to reencode the bdf files and
  910.      build X11 fonts that contain the ligatures (i.e standard encoding).
  911.  
  912.      If you have the Type1 fonts mentioned above, and you installed the
  913.      Type1 rasterizer into you font or X server, you can use the
  914.      appended fonts.scale to name your fonts so that ghostscript can
  915.      find them.
  916.  
  917.      Font resources:
  918.  
  919.        1. `useExternalFonts'(`UseExternalFonts'): Default value: true.
  920.           This resource controls whether X11 fonts will be used.
  921.  
  922.        2. `useScalableFonts'(`UseScalableFonts'): Default value: true.
  923.           This resource controls whether scalable fonts will be used.
  924.           If you have an outline scaler in your X server, you should
  925.           have this on.  If you have an X terminal, you may get
  926.           slightly better performance with this on.  If you have to use
  927.           the X11 bitmap scaler, turn this off.  Fonts scaled by the
  928.           bitmap scaler look worse than the default ghostscript fonts.
  929.  
  930.        3. `logExternalFonts'(`LogExternalFonts'): Default value: false.
  931.           Controls whether to report when X11 fonts are being used.
  932.  
  933.      The following fonts.scale makes all of the fonts of the Adobe Type
  934.      Manager and Adobe Plus pack available in standard and ISO Latin 1
  935.      encoding.  (We were able to purchase the above two packages at an
  936.      educational discount price of $150.)
  937.  
  938. 70
  939. agw_____.pfb -Adobe-ITC Avant Garde Gothic-Book-r-normal--0-0-0-0-p-0-iso8859-1
  940. agwo____.pfb -Adobe-ITC Avant Garde Gothic-Book-o-normal--0-0-0-0-p-0-iso8859-1
  941. agd_____.pfb -Adobe-ITC Avant Garde Gothic-Demi-r-normal--0-0-0-0-p-0-iso8859-1
  942. agdo____.pfb -Adobe-ITC Avant Garde Gothic-Demi-o-normal--0-0-0-0-p-0-iso8859-1
  943. bkl_____.pfb -Adobe-ITC Bookman-Light-r-normal--0-0-0-0-p-0-iso8859-1
  944. bkli____.pfb -Adobe-ITC Bookman-Light-i-normal--0-0-0-0-p-0-iso8859-1
  945. bkd_____.pfb -Adobe-ITC Bookman-Demi-r-normal--0-0-0-0-p-0-iso8859-1
  946. bkdi____.pfb -Adobe-ITC Bookman-Demi-i-normal--0-0-0-0-p-0-iso8859-1
  947. com_____.pfb -Adobe-Courier-Medium-r-normal--0-0-0-0-m-0-iso8859-1
  948. coo_____.pfb -Adobe-Courier-Medium-o-normal--0-0-0-0-m-0-iso8859-1
  949. cob_____.pfb -Adobe-Courier-Bold-r-normal--0-0-0-0-m-0-iso8859-1
  950. cobo____.pfb -Adobe-Courier-Bold-o-normal--0-0-0-0-m-0-iso8859-1
  951. hv______.pfb -Adobe-Helvetica-Medium-r-normal--0-0-0-0-p-0-iso8859-1
  952. hvo_____.pfb -Adobe-Helvetica-Medium-o-normal--0-0-0-0-p-0-iso8859-1
  953. hvb_____.pfb -Adobe-Helvetica-Bold-r-normal--0-0-0-0-p-0-iso8859-1
  954. hvbo____.pfb -Adobe-Helvetica-Bold-o-normal--0-0-0-0-p-0-iso8859-1
  955. hvn_____.pfb -Adobe-Helvetica-Medium-r-Narrow--0-0-0-0-p-0-iso8859-1
  956. hvno____.pfb -Adobe-Helvetica-Medium-o-Narrow--0-0-0-0-p-0-iso8859-1
  957. hvnb____.pfb -Adobe-Helvetica-Bold-r-Narrow--0-0-0-0-p-0-iso8859-1
  958. hvnbo___.pfb -Adobe-Helvetica-Bold-o-Narrow--0-0-0-0-p-0-iso8859-1
  959. ncr_____.pfb -Adobe-New Century Schoolbook-Medium-r-normal--0-0-0-0-p-0-iso8859-1
  960. nci_____.pfb -Adobe-New Century Schoolbook-Medium-i-normal--0-0-0-0-p-0-iso8859-1
  961. ncb_____.pfb -Adobe-New Century Schoolbook-Bold-r-normal--0-0-0-0-p-0-iso8859-1
  962. ncbi____.pfb -Adobe-New Century Schoolbook-Bold-i-normal--0-0-0-0-p-0-iso8859-1
  963. por_____.pfb -Adobe-Palatino-Medium-r-normal--0-0-0-0-p-0-iso8859-1
  964. poi_____.pfb -Adobe-Palatino-Medium-i-normal--0-0-0-0-p-0-iso8859-1
  965. pob_____.pfb -Adobe-Palatino-Bold-r-normal--0-0-0-0-p-0-iso8859-1
  966. pobi____.pfb -Adobe-Palatino-Bold-i-normal--0-0-0-0-p-0-iso8859-1
  967. sy______.pfb -Adobe-Symbol-Medium-r-normal--0-0-0-0-p-0-iso8859-1
  968. tir_____.pfb -Adobe-Times-Medium-r-normal--0-0-0-0-p-0-iso8859-1
  969. tii_____.pfb -Adobe-Times-Medium-i-normal--0-0-0-0-p-0-iso8859-1
  970. tib_____.pfb -Adobe-Times-Bold-r-normal--0-0-0-0-p-0-iso8859-1
  971. tibi____.pfb -Adobe-Times-Bold-i-normal--0-0-0-0-p-0-iso8859-1
  972. zcmi____.pfb -Adobe-ITC Zapf Chancery-Medium-i-normal--0-0-0-0-p-0-iso8859-1
  973. zd______.pfb -Adobe-ITC Zapf Dingbats-Medium-r-normal--0-0-0-0-p-0-iso8859-1
  974. agw_____.pfb -Adobe-ITC Avant Garde Gothic-Book-r-normal--0-0-0-0-p-0-adobe-fontspecific
  975. agwo____.pfb -Adobe-ITC Avant Garde Gothic-Book-o-normal--0-0-0-0-p-0-adobe-fontspecific
  976. agd_____.pfb -Adobe-ITC Avant Garde Gothic-Demi-r-normal--0-0-0-0-p-0-adobe-fontspecific
  977. agdo____.pfb -Adobe-ITC Avant Garde Gothic-Demi-o-normal--0-0-0-0-p-0-adobe-fontspecific
  978. bkl_____.pfb -Adobe-ITC Bookman-Light-r-normal--0-0-0-0-p-0-adobe-fontspecific
  979. bkli____.pfb -Adobe-ITC Bookman-Light-i-normal--0-0-0-0-p-0-adobe-fontspecific
  980. bkd_____.pfb -Adobe-ITC Bookman-Demi-r-normal--0-0-0-0-p-0-adobe-fontspecific
  981. bkdi____.pfb -Adobe-ITC Bookman-Demi-i-normal--0-0-0-0-p-0-adobe-fontspecific
  982. com_____.pfb -Adobe-Courier-Medium-r-normal--0-0-0-0-m-0-adobe-fontspecific
  983. coo_____.pfb -Adobe-Courier-Medium-o-normal--0-0-0-0-m-0-adobe-fontspecific
  984. cob_____.pfb -Adobe-Courier-Bold-r-normal--0-0-0-0-m-0-adobe-fontspecific
  985. cobo____.pfb -Adobe-Courier-Bold-o-normal--0-0-0-0-m-0-adobe-fontspecific
  986. hv______.pfb -Adobe-Helvetica-Medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
  987. hvo_____.pfb -Adobe-Helvetica-Medium-o-normal--0-0-0-0-p-0-adobe-fontspecific
  988. hvb_____.pfb -Adobe-Helvetica-Bold-r-normal--0-0-0-0-p-0-adobe-fontspecific
  989. hvbo____.pfb -Adobe-Helvetica-Bold-o-normal--0-0-0-0-p-0-adobe-fontspecific
  990. hvn_____.pfb -Adobe-Helvetica-Medium-r-Narrow--0-0-0-0-p-0-adobe-fontspecific
  991. hvno____.pfb -Adobe-Helvetica-Medium-o-Narrow--0-0-0-0-p-0-adobe-fontspecific
  992. hvnb____.pfb -Adobe-Helvetica-Bold-r-Narrow--0-0-0-0-p-0-adobe-fontspecific
  993. hvnbo___.pfb -Adobe-Helvetica-Bold-o-Narrow--0-0-0-0-p-0-adobe-fontspecific
  994. ncr_____.pfb -Adobe-New Century Schoolbook-Medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
  995. nci_____.pfb -Adobe-New Century Schoolbook-Medium-i-normal--0-0-0-0-p-0-adobe-fontspecific
  996. ncb_____.pfb -Adobe-New Century Schoolbook-Bold-r-normal--0-0-0-0-p-0-adobe-fontspecific
  997. ncbi____.pfb -Adobe-New Century Schoolbook-Bold-i-normal--0-0-0-0-p-0-adobe-fontspecific
  998. por_____.pfb -Adobe-Palatino-Medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
  999. poi_____.pfb -Adobe-Palatino-Medium-i-normal--0-0-0-0-p-0-adobe-fontspecific
  1000. pob_____.pfb -Adobe-Palatino-Bold-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1001. pobi____.pfb -Adobe-Palatino-Bold-i-normal--0-0-0-0-p-0-adobe-fontspecific
  1002. sy______.pfb -Adobe-Symbol-Medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1003. tir_____.pfb -Adobe-Times-Medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1004. tii_____.pfb -Adobe-Times-Medium-i-normal--0-0-0-0-p-0-adobe-fontspecific
  1005. tib_____.pfb -Adobe-Times-Bold-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1006. tibi____.pfb -Adobe-Times-Bold-i-normal--0-0-0-0-p-0-adobe-fontspecific
  1007. zcmi____.pfb -Adobe-ITC Zapf Chancery-Medium-i-normal--0-0-0-0-p-0-adobe-fontspecific
  1008. zd______.pfb -Adobe-ITC Zapf Dingbats-Medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
  1009.  
  1010. 4.2 gspreview
  1011. =============
  1012.  
  1013.    This is another front-end for Ghostscript.  I have gotten and built
  1014. it, and actually preferred the user interface, but it had a few bugs.
  1015. It didn't seem as full-featured as ghostview, though.  (Not that there
  1016. are all *that* many features in ghostview, but it does its job well).
  1017. `ftp.x.org:/contrib/gspreview...'
  1018.  
  1019. 4.3 xdvi
  1020. ========
  1021.  
  1022.    A beautifully legible previewing program for dvi with a handy
  1023. zoom+pan feature.  Will not interpret PostScript specials, which are
  1024. understood only by `dvips' (back to the compiler, object file, and now
  1025. linker analogy :-)  To view a file, do `xdvi file.dvi'.  This comes
  1026. with either TeX or X in most distributions.  Either way, you've
  1027. probably got one.  If not, look in `ftp.x.org:/contrib/'.
  1028.  
  1029. 4.4 xtex
  1030. ========
  1031.  
  1032.    Xtex is similar in purpose to xdvi.  I have tried to build it under
  1033. Linux and failed.  It is available as:
  1034. `ftp.x.org:/contrib/xtex-2.18.5.tar.z'
  1035.  
  1036. 4.5 gxditview
  1037. =============
  1038.  
  1039.    Ditview produces a preview version of `troff' source using X fonts.
  1040. `groff -TX100 -mandoc MAN PAGE' will run gxditview to show you a
  1041. typeset version of the man page.  `-TX75' is the same thing, but tiny.
  1042. Most distributions don't have a working one at all.  A good one comes
  1043. with the source to `groff', which you might want to get anyway for the
  1044. additional drivers (some distributions are missing some, including
  1045. PostScript).
  1046. `prep.ai.mit.edu:/pub/gnu/groff-XXXX.tar.z'
  1047.  
  1048. 4.6 non-X previewing
  1049. ====================
  1050.  
  1051.    Ghostscript comes with pc video hardware drivers, but under un*x
  1052. these are not a good thing.  However, there are `gs' binaries around
  1053. which will use the Linux VGA library (`svgalib').  The Ghostscript
  1054. device for this is called linux, thus `gs -sDEVICE=linux file.ps' will
  1055. show you an image of the PostScript.  The environment variable
  1056. `GSVGAMODE' is important for this.  Set it to the nuber of the video
  1057. mode you want, taken from the vga.h which comes with vgalib.
  1058.  
  1059.    If you need this driver, a patch to put in Linux svgalib is available
  1060. from the printing mail server or as:
  1061.      ws105.zfn.uni-bremen.de:/pub/gs261-linuxdriver.sh
  1062.      ws105.zfn.uni-bremen.de:/pub/gs261-svgalib.tar.gz
  1063.  
  1064.    Another possibly different svgalib patch is found in:
  1065. `ftp.cdrom.com:/pub/linux/misc'
  1066.  
  1067.    The plain vgalib driver is available on Sunsite.
  1068.  
  1069.    Texmgr is a program which will preview dvi under MGR.  I don't
  1070. beleive that it currently works under Linux MGR, but if it does, MGR
  1071. uses sufficiently less memory and disk that this might be an attractive
  1072. option for some.
  1073.  
  1074.    dvgt is a program which will preview dvi with Linux svgalib, or on
  1075. one of several types of graphics terminals including vt, tek, or a PC
  1076. with MS-Kermit.  It is available on sunsite.
  1077.  
  1078. 5 Ascii Translation
  1079. *******************
  1080.  
  1081.    These sections describe various programs which can generate plain
  1082. ascii from some file formats.
  1083.  
  1084. 5.1 from TeX
  1085. ============
  1086.  
  1087.    Lametex will generate ascii from TeX source.  It is available as:
  1088. `sunsite.unc.edu:/pub/Linux/apps/tex/lametex.tar.z'
  1089.  
  1090.    LaTeX is used by the Linux Doc Projext to generate text versions of
  1091. their manuals.  I don't know where to find it.
  1092.  
  1093. 5.2 from dvi
  1094. ============
  1095.  
  1096.    `dvi2tty' is a program which will process dvi into text.  Aparently,
  1097. it will also make an effort at reproducing graphics as well.  I do not
  1098. know where to find it.
  1099.  
  1100. 5.3 from PostScript
  1101. ===================
  1102.  
  1103.    Ghostscript 2.6.1 comes with a script file which will use `gs' to
  1104. extract just the text from a ps file, called `ps2ascii'.  (*note
  1105. PostScript., for information above for where it can be found).
  1106. Further documentation is in the Ghostscript 2.6.1 distribution files
  1107. `gs_2asc.ps' and `use.doc'
  1108.  
  1109. 5.4 from troff
  1110. ==============
  1111.  
  1112.      groff -Tascii or -Tlatin1 ...
  1113.  
  1114. 5.5 from ascii/latin1
  1115. =====================
  1116.  
  1117.    The GNU program `recode' handles conversion between various forms of
  1118. straight text encoding, ie from Latin-1 to ASCII.  This is available on
  1119. prep.ai.mit.edu.
  1120.  
  1121. --
  1122. Unless otherwise stated, Linux HOWTO documents are copyrighted by their
  1123. respective authors. Linux HOWTO documents may be reproduced and distributed 
  1124. in whole or in part, in any medium physical or electronic, without permission 
  1125. of the author. Translations and derivative works are similarly permitted 
  1126. without express permission. Commercial redistribution is allowed and 
  1127. encouraged; however, the author would like to be notified of any such 
  1128. distributions. 
  1129.  
  1130. In short, we wish to promote dissemination of this information through as
  1131. many channels as possible. However, we do wish to retain copyright on the
  1132. HOWTO documents, and would like to be notified of any plans to redistribute
  1133. the HOWTOs. If you have questions, please contact Matt Welsh, the Linux
  1134. HOWTO coordinator, at mdw@sunsite.unc.edu.
  1135.  
  1136.