README 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. "lpstyl version 0.9.9"
  2. This is an Apple StyleWriter driver for un*x. It was developed on
  3. NetBSD-mac68k, and has been reported to work on NetBSD-i386,
  4. linux-pmac, mklinux-ppc, and linux-x86.
  5. Supported printers include:
  6. StyleWriter I
  7. StyleWriter II
  8. StyleWriter III (aka StyleWriter 1200)
  9. Color StyleWriter 1500
  10. Color StyleWriter 2200
  11. Color StyleWriter 2400
  12. Color StyleWriter 2500
  13. If you have some breed of StyleWriter besides the ones mentioned
  14. here, feel free to try it. The driver should realize that it
  15. doesn't know what sort of printer you have and try to treat it like
  16. a StyleWriter II or 2400, depending on values the printer returns.
  17. Try it and see, and please let me know what happens.
  18. Random notes about this version:
  19. Since the StyleWriter has no built-in fonts, this driver only prints
  20. a couple of types of raster image files at 360 dpi (the standard
  21. printer resolution of StyleWriters). It is expected that gs will
  22. be used to create these files from PostScript files, but if you
  23. have some other way of creating them, feel free. The printcap
  24. entry and shell scripts in this kit will allow you to "lpr" a
  25. postscript or ascii text file and have it printed directly (without
  26. ever creating the raster file on disk) by piping output from gs to
  27. the driver.
  28. If the printer runs out of paper, the driver will usually wait
  29. indefinitely for the problem to go away, retrying every 30 seconds.
  30. It will also send messges to the log file to this effect. On the
  31. 2400/2500, the retry will be every 5 seconds, and it won't reset
  32. the printer or resend any data. I say "usually" because if the
  33. out-of-paper condition is detected at the wrong time, the driver
  34. doesn't quite know how to deal with it. In these cases, it will
  35. exit with an non-zero status.
  36. If you want to turn the printer off during a long print job, the
  37. driver needs to be informed so that the printer's buffered data
  38. isn't lost. Sending the driver process a SIGUSR1 will tell it to
  39. suspend printing after the current page finishes. The driver will
  40. print a line to the lpd log file telling you when it is OK to turn
  41. off the printer. While printing is suspended, the printer can be
  42. turned off, disconnected, etc. (You can even connect a different
  43. type of StyleWriter -- when you restart printing, the driver will
  44. identify the printer again.) Sending another SIGUSR1 will resume
  45. printing with the next page.
  46. The driver program itself is a pure filter -- it depends on lpd to
  47. connect its stdin and stdout to an image file and the tty the
  48. printer is attached to, respectively. The printcap entry and sample
  49. scripts assume that the printer is attached to /dev/stylewriter,
  50. which whould be a symbolic link to whatever serial device the
  51. printer is connected to. (In netbsd-mac68k, the printer port is
  52. /dev/tty01.)
  53. The driver program accepts the following flags:
  54. -f <device node>
  55. Tells the driver to open a device directly instead of using
  56. stdout to talk to the printer.
  57. -t <file format>
  58. Tells the driver which file format to expect for input. Currently
  59. this can be pbmraw, bit, or bitcmyk. Using "bitcmyk" implies that
  60. the driver will attempt to print in color.
  61. -h <height>
  62. -w <width>
  63. Tells the driver the height and width of the input file. This will
  64. be overridden by the embedded dimension data in pbmraw files.
  65. These parameters are required for bit and bitcmyk files, since they
  66. have no embedded height and width.
  67. -m
  68. Disables the normal cropping that is done to take the top and left
  69. margins into account. This probably shouldn't be used for properly
  70. typeset pages (it will cause them to be shifted down and to the right
  71. instead of being properly placed on the page), but it can be useful
  72. for files that don't take page margins into account, like some of the
  73. samples that come with ghostscript.
  74. -v
  75. Increases the amount of debugging information the driver sends
  76. to stderr. Multiple v's give more output. Currently more than
  77. two doesn't do anything different, but feel free to add as many
  78. as you like if it makes you happy. The stderr of the driver is
  79. normally directed to /var/log/lpd-errs (or whatever file is
  80. specified in the printcap entry) by lpd. Watching this file
  81. with 'tail -f' can be informative.
  82. -p letter
  83. -p a4
  84. Sets the paper size the driver expects. Default is "letter".
  85. -H <height>
  86. -W <width>
  87. Another way of setting the paper size. Height and width are in
  88. printer pixels. One printer pixel is 1/360 of an inch. No sanity
  89. checking is done on the arguments, so be nice.
  90. -?
  91. Prints a usage message.
  92. If the driver is compiled with AppleTalk support, the following options are
  93. also available:
  94. -a <nbpname>
  95. Specify the name of the AppleTalk printer you want to use. This is the
  96. switch that tells the driver to use AppleTalk instead of serial
  97. communication. nbpname can be specified in standard AppleTalk wildcard
  98. format (properly quoted to avoid shell expansion), but a name which
  99. matches multiple devices may produce undesired results.
  100. -u <username>
  101. Specify the username that will be shown to other users while the printer
  102. is busy. This can be any string, but I recommend a proper 'user@host'
  103. to avoid confusion. The sample AppleTalk driver scripts show how to
  104. do this with the standard parameters that lpd passes to driver programs.
  105. MANIFEST
  106. This kit includes the following files:
  107. README:
  108. this file
  109. README.atalk:
  110. notes about using the driver with AppleTalk
  111. README.troubleshooting:
  112. common questions and answers
  113. README.protocol:
  114. information about the control protocol StyleWriters use
  115. lpstyl.c:
  116. the source for the driver program
  117. adsp.c:
  118. adsp.h:
  119. an implementation of a subset of the adsp protocol
  120. printcap:
  121. a sample printcap file that uses the driver
  122. printcap.a4:
  123. a sample printcap file for use with A4 paper
  124. stylps:
  125. stylps-color:
  126. stylascii:
  127. Shell scripts (used by the printcap example) that plug together
  128. GhostScript, enscript, and the printer driver in various ways.
  129. Henceforth known as "the driver scripts".
  130. stylps-atalk:
  131. stylps-color-atalk:
  132. stylascii-atalk:
  133. Similar to the above, but using AppleTalk for communication.
  134. direct_stylpbm:
  135. direct_stylps:
  136. Shell scripts that take pbmraw and postscript files as standard input
  137. and use the lpstyl driver (and ghostscript, for direct_stylps) to
  138. send them to a StyleWriter connected to /dev/stylewriter. Note that
  139. you must have read/write access to the tty for this to work. These
  140. are included mostly as examples and for testing purposes. It's much
  141. more pleasant to use lpd, once you get it set up.
  142. styl.ppd:
  143. Experimental ppd file for use with systems that expect one
  144. (such as netatalk/papd or the LaserWriter 8.5 driver using 'lpd'
  145. protocol). This is the first time I've tried writing one of these
  146. things, so corrections are welcome.
  147. control_codes:
  148. Information about the control protocol the driver uses, written after
  149. the fact. If this file and the source code conflict, believe the source.
  150. INSTALLATION
  151. To make this thing work, do the following:
  152. - compile lpstyl.c to create the executable lpstyl
  153. - make sure that the path to gs is correct in stylps (it assumes
  154. /usr/local/gnu/bin/gs)
  155. - make lpstyl and the driver scripts world-executable and put them
  156. somewhere public (I suggest /usr/local/sbin)
  157. - make sure that the path to lpstyl is correct in the driver scripts (they
  158. assume /usr/local/sbin/lpstyl, etc.)
  159. - make /dev/stylewriter a symbolic link to the serial port your printer is
  160. connected to. (On netbsd-mac68k, the printer port is /dev/tty01.)
  161. - install the printcap entries into /etc/printcap (making sure that all
  162. paths are correct there, too)
  163. - make sure the spool directory specified in the printcap entry exists
  164. - kick lpd so that it re-reads /etc/printcap
  165. That should do it. Find a postscript file and 'lpr -Pstylps file.ps'
  166. (Or, if you don't have a postscript file handy, print your favorite
  167. man page with
  168. 'groff -mandoc /usr/local/share/man/man1/manpage.1 |lpr -Pstylps'.)
  169. CONTACTS
  170. I can be reached via email at monroe@pobox.com. The latest version
  171. of this package will reside at <http://www.pobox.com/~monroe/styl/>.
  172. If you use this driver successfully, or want to use it but can't
  173. get it to work, feel free to send me email. If you make improvements
  174. to or have questions about this package, please do send them my
  175. way.
  176. -- Monroe Williams a.k.a. monroe@pobox.com --
  177. Copyright 1996-2000 Monroe Williams, all rights reserved.