home *** CD-ROM | disk | FTP | other *** search
/ Peanuts NeXT Software Archives / Peanuts-1.iso / CDROM / READMEs / Peanuts-3 / Tools / printer / lj2ps.README < prev    next >
Encoding:
Text File  |  1996-11-09  |  12.7 KB  |  284 lines

  1.                 lj2ps
  2.            A LaserJet PCL to PostScript Translator
  3.  
  4.             Version 1.3 (release)
  5.  
  6.               Christopher Lishka
  7.         Wisconsin State Laboratory of Hygiene
  8.               Data Processing Department
  9.                 
  10.                 Modifications for the NeXT by:
  11.                 
  12.                 Dave Nanian, UnderWare, Inc.
  13.  
  14.                 30 May 1991
  15.  
  16.  
  17.                   Contents:
  18.  
  19.         1. Introduction
  20.         2. This Distribution, and How To Create lj2ps
  21.         3. Implementation Notes
  22.         4. Miscellaneous (Things I Have To Get Off My Chest)
  23.         5. Contacting Me
  24.         6. Notes on the NeXT release
  25.  
  26.  
  27. 1. Introduction
  28.  
  29. The lj2ps program translates HP LaserJet PCL ("Page Control Language")
  30. to PostScript.  Currently it converts a subset of the LaserJet Series
  31. II language (PCL 4) to device-independent PostScript.
  32.  
  33. lj2ps was originally written to allow my organization to "upgrade" our
  34. LaserJets to LaserWriters, yet still have a way to print PCL files.
  35. Due to a lack of time, not all of PCL is emulated (this is discussed
  36. below).  I am releasing this program to the "real world" at the
  37. suggestion of by boss and coworkers, and with the hope that others
  38. will also find this program useful and may even extend its
  39. capabilities.
  40.  
  41. lj2ps is currently at revision 1.3.  This revision contains changes
  42. implemented by Dave Nanian to make lj2ps work on the NeXT.
  43.  
  44. The previous revision (1.2) simply fixed
  45. problems in the revision 1.1 distribution that was sent out on June
  46. 30th, 1990.  Specifically, the shar which I was using (which I thought
  47. was *supposed* to automatically uuencode files which contained
  48. non-printing ASCII characters) failed to uuencode anything (I guess it
  49. only uuencodes binary files, which is somewhat useless in this case).
  50. Therefore, all of the escape characters were eaten in the Metrics and
  51. Tests directories.  *All* files in the these directories are now
  52. properly uuencoded.  Also, I have a habit of using long filenames,
  53. which 4.3 BSD UNIX is perfectly happy with, but which System V UNIX
  54. and MS-DOS choke on.  Therefore, I have fixed all filenames so that
  55. they are no longer than eight characters, with a "dot-extension" of no
  56. more than three characters.  This should make most people happy.
  57.  
  58.  
  59. 2. This Distribution, and How To Create lj2ps
  60.  
  61. Included in this distribution are all of the source files for lj2ps,
  62. documentation, a test suite, and a metrics suite.
  63.  
  64. All source files are included in the top level directory, along with
  65. the Makefile and README file.  To create lj2ps, simply type "make".
  66. To clean the directory, type "make clean".  Pretty simple, huh? ;-)
  67. There are probably other options in the Makefile, but since I
  68. regularly use "cake" (instead of make), and since I generated it with
  69. mkmf (automatic Makefile creator), I am not sure what they are.  Feel
  70. free to edit it.  Those who are interested in the Cakefile, please
  71. contact me.
  72.  
  73. The Tests directory contains many tests used to check the
  74. compatibility of lj2ps with real LaserJets.  Similarly, the Metrics
  75. directory is used to tune lj2ps to produce output which looks like
  76. LaserJet output.  These are discussed in more detail in the
  77. implementation section below.  Both directories have been packaged
  78. with all files uuencoded, because there was a major problem in the 1.1
  79. distribution with the escape characters getting eaten by mailers.  To
  80. unpack the files, "cd" into each directory and run the sh-script
  81. "uu.unpack".  This will automatically uudecode each file and remove
  82. the uuencoded files.
  83.  
  84. The documentation directory has several files in it.  Here are
  85. explanations of them:
  86.  
  87. BugFile        Known bugs that affect lj2ps are detailed here.  Each
  88.         entry identifies the date detected, revision affected,
  89.         and the person logging the bug (usually me!).  The
  90.         LogFile describes which bugs have been fixed.
  91.  
  92. Copying        This is the standard Free Software Foundation
  93.         copyleft.  lj2ps is distributed according to these
  94.         restrictions.  Please look through it so that you are
  95.         familiar with the conditions of use for lj2ps.  The
  96.         only other thing that I ask is that you send me
  97.         changes (with descriptions) if you make them, so that
  98.         I can benefit from your work.
  99.  
  100. LogFile        This file contains descriptions of each revision of
  101.         lj2ps.  All changes including bug fixes, added
  102.         features, and removals are detailed here.
  103.  
  104. commands.doc    As detailed below, I did not have time to emulate all
  105.         PCL commands.  This list shows which ones are (and
  106.         are not) supported.
  107.  
  108. comopts.doc    Options are available at compile-time to conditionally
  109.         include or exclude features when the program is
  110.         created.  This file describes the options currently
  111.         available.
  112.  
  113. limits.doc    Any program worth its salt has certain limitations.
  114.         lj2ps is no exception.  This file lists some that I
  115.         know about.  Feel free to fix any (or all) of them.
  116.  
  117. lj2ps.l        The man page for lj2ps, to be installed in
  118.         /usr/man/manl.  Use the command "nroff -man lj2ps.l"
  119.         to create the documentation file.
  120.  
  121. measures.doc    One of the worst aspects of LaserJets is the many
  122.         different measurements used by different commands,
  123.         This file lists all measurements that I know of.
  124.  
  125. pscan.idr    A diagram of the parameter scanner.  This file was
  126.         produced with the drawing program "idraw," and can be
  127.         printed on any PostScript printer.
  128.  
  129. scanner.doc    There are two distinct (yet related) scanners used in
  130.         lj2ps.  Scanner.doc describes the conceptual design I
  131.         used in creating them, which is derived from standard
  132.         scanner and finite state automata theory taught in
  133.         college (where do you think I learned it from? ;-).
  134.  
  135. suggest.doc    This file lists aspects of lj2ps that need work.  It
  136.         may also provide some insight as to how lj2ps was
  137.         designed.  If you have some free time, and need some
  138.         suggestions on how to improve the program, then look
  139.         here. 
  140.  
  141. tscan.idr    A diagram of the text scanner.  This file was produced
  142.         with the drawing program "idraw," and can be printed
  143.         on any PostScript printer.
  144.  
  145.  
  146. 3. Implementation Notes
  147.  
  148. The program is written completely in K&R C (although not ANSI), and
  149. the C code should compile on nearly every standard machine out there.
  150. To my knowledge, I have not used any "strange" C operators or
  151. combinations, so this program should work on anything from a PC to a
  152. super-computer.
  153.  
  154. I built the program with the idea of emulating full LJII PCL, so all
  155. of the actual command syntax is parsed.  However, I have only
  156. implemented the commands which I needed.  Left out are graphics,
  157. macros, and soft font commands (among others).  It should not be that
  158. hard to add features to this program, and I have included variables
  159. (some yet unused) for most (if not all) aspects of LaserJet operation.
  160. Feel free to work on extending this program to emulate the unfinished
  161. PCL commands, as well as fixing some of the inconsistencies that will
  162. likely pop up.  All I ask is that you send me any changes that you
  163. make, so I can add the same features to my own version (my address is
  164. listed at the end of this file).
  165.  
  166. I have designed lj2ps with efficiency in mind.  To this end, I
  167. hand-coded the scanner in C instead of generating it with Lex.  I have
  168. also spent some time profiling the execution.  Although one major
  169. bottleneck has been fixed, most of the program actually runs at a
  170. reasonable rate.  As would be expected, much of the execution time is
  171. spent in the scanner and _doprnt.  The scanner could likely be sped up
  172. some more (a colleague suggests "caching" several variables in
  173. registers), but I have left this for the future.
  174.  
  175. I have also designed the program with accuracy in mind.  Included in
  176. this distribution are two suites of files: one for testing, the other
  177. for accurate reproduction.  The test suite is an attempt at providing
  178. test files which will exercise critical and nit-picky features of
  179. LaserJet Series II printers.  It is by no means complete.  I have only
  180. included tests for features that are needed at our organization, and I
  181. have likely even left out some of these.  I encourage you to add more
  182. files to the test suite; if several people contribute, a nice
  183. collection could be created.  The metrics suite provides print samples
  184. which highlight different measurements.  For instance, you could test
  185. inter-line spacing by printing the appropriate metrics file on a
  186. LaserJet and a PostScript printer, and then tweak lj2ps to match the
  187. LaserJet's output.  This suite is also not complete, so feel free to
  188. add more files.
  189.  
  190.  
  191. 4. Miscellaneous (Things I Have To Get Off My Chest)
  192.  
  193. It is unlikely that I will have any time at work to extend this
  194. program.  I will only support it locally for our users at my
  195. organization.  Although it would be nice to work on this during my
  196. free time (i.e. after work), I have so many other program (and
  197. non-program) ideas that I likely won't do much more with lj2ps.
  198. Therefore it is up to you to build in the missing functionality that
  199. you want and need.
  200.  
  201. Even though the major reason I wrote this was because our organization
  202. needed it, a significant driving-force for me was a "proof of
  203. concept."  I always thought that PostScript was a much better language
  204. than LaserJet PCL, and this program provided me with a way to prove
  205. it.  Even though this revision of lj2ps is limited, I am convinced
  206. that one could fully emulate a LaserJet with a filter (like lj2ps) and
  207. a PostScript printer.  In fact, I bet it could be done with PostScript
  208. alone, although it would be incredibly slow.  However, one cannot
  209. emulate a PostScript printer using PCL.  Most (if not all) PostScript
  210. to LaserJet emulators are programs (in software or hardware) which
  211. send bitmaps to a LaserJet; PCL is pretty-much bypassed.  This says a
  212. lot about the two languages.
  213.  
  214. I have spent several years writing programs which use PCL on
  215. LaserJets.  I have just finished a translator that parses and emulates
  216. PCL.  With all this experience and time spent using PCL, all I can say
  217. is that it leaves a really bad taste in my mouth.  It is not user
  218. friendly, not consistent, and not robust.  Its syntax is lousy, its
  219. commands are impossible to remember, and it inner workings are very
  220. hard to figure out (believe me, I spent too much time doing this!).
  221. Whoever is responsible for developing PCL ought to be taught a lesson,
  222. and probably sent back to college to study language design.  I have
  223. much respect for many Hewlett Packard products (like the hp28s and
  224. hp48sx calculators).  However, the LaserJet's language is one of HP's
  225. worst creations.  Suffice it to say that the HP LaserJet is the IBM PC
  226. of the laser-printer world.
  227.  
  228.  
  229. 5. Contacting Me
  230.  
  231. If you have any additions, fixes, or problems; need to know more about
  232. the secret workings of the code; have suggestions for improving lj2ps;
  233. or simply want to say hello, you can contact me at:
  234.  
  235.     Internet:    lishka@uwslh.slh.wisc.edu
  236.     UUCP:        ...!uunet!uwvax!uwslh!lishka
  237.  
  238.     Work phone:    (608) 262-4485 (Tues.-Sat., 9am-5pm)
  239.  
  240.     Address:    Christopher Lishka
  241.             Data Processing Dept.
  242.             Wisconsin State Laboratory of Hygiene
  243.             465 Henry Mall
  244.             Madison, WI     53715
  245.  
  246. My only real request is that you send me any bug fixes, enhancements,
  247. or other modifications that you have made.  Please don't send source
  248. trees without contacting me first.  The best thing to send is a
  249. context-diff (e.g. for "patch") from some released version.
  250.  
  251. If you like this program enough to donate some money, then I ask that
  252. you give it to charity (for example: an environmental, peace, or
  253. homeless organization).  It will make both of us feel good, and it is
  254. even tax-deductible.
  255.  
  256. 6. Notes on the NeXT specific changes
  257.  
  258. As Christopher didn't have a NeXT to play with, and doesn't seem to be
  259. available at his old EMAIL address any more, I guess I take responsibility
  260. for this program on the NeXT.  I ported the program to make it easy to print
  261. from PCL programs under SoftPC, and it seems to work quite well for this
  262. purpose.
  263.  
  264. I've made some changes and fixed some problems, specifically with Landscape
  265. mode.  Changes were made to support manual feed on the NeXT, allow page
  266. reversing to be suppresed, and include the proper include files.  The
  267. measurements were also tailored to the capabilities of the NeXT printer.
  268.  
  269. Compiling this program on a non-NeXT should work just fine:  the bugs that
  270. I fixed should be fixed in all versions, and if compiled on the NeXT, I've
  271. put #if defined (NeXT) ...#endif pairs around the NeXT specific code.
  272.  
  273. Problems:  Note that some problems remain.  I've noticed that the movement
  274. calls aren't entirely accurate, though this seems to be a problem with all
  275. versions.  Also, on the NeXT, there doesn't seem to be any way to turn
  276. manual feed on and off on a per-page basis.  Because of this, if manual
  277. feed is turned on at any time during the translation of the document, the
  278. resulting postscript file will all be manual feed.  Finally, page reversing
  279. is suppressed by removing the %%Page comments from the output, which also
  280. makes the documents non-conforming.  I expect to fix all of these problems
  281. when NeXT's PostScript conforms to the new Adobe Reference manual.
  282.  
  283. Hope this works for you:  enjoy!  You can reach me at dnanian@uw.com, or
  284. uunet!uw!dnanian.