home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3937 / README < prev   
Encoding:
Text File  |  1991-08-30  |  5.6 KB  |  172 lines

  1.             HP2PBM et. al.
  2.             Version 0.00
  3.             Chris Lewis    <clewis@ferret.ocunix.on.ca>
  4.             Klaus Schallhorn    <klaus@cnix.uucp>
  5.  
  6. The first section of this README is a discussion of how you
  7. integrate this package with faxpak, the second half is how
  8. to integrate with psroff.
  9.  
  10. Introduction and FAXPAK:
  11.  
  12. hp2* being a number of programs with a number of uses is somewhat 
  13. difficult to explain.
  14.  
  15. I bolted this together basically to have a filter from HPCL escape
  16. sequences to fax. Without Chris Lewis' hpinterp.c, which does the
  17. parsing of escape sequences, I probably wouldn't have started this.
  18. Using Chris' parser and a few routines I borrowed from faxpak and 
  19. some earlier code I wrote hp2* in a few evening hours. I also spent
  20. some time creating two "built in" fonts and all the built in pattern
  21. and raster clones my antique hp ljet plus knows about.
  22.  
  23. hp2* is an integrated part of psroff. It is, as of now, also an
  24. integrated part of faxpak. 
  25.  
  26. Some of the things you can do with hp2*:
  27.  
  28.     psroff -Tlj -t <files> | fax phone -type hp
  29.     jetroff | fax phone -type hp
  30.     CorelDraw | hp2e24 | pbmtoe24 | lpr -d mytrustedepsonprinter
  31.     psroff -Tlj -t <files> | hp2e24 | pbm2e24 | lpr -d epson
  32.     TeX | dvijep | fax -type hp
  33.  
  34. Yes, strangely enough faxpak now supports two routes from TeX to fax,
  35. one which requires dvitopbm and a huge assortment of pk fonts in low
  36. and high fax resolution, and the one made possible by hp2* where fonts
  37. "downloaded" by dvijep are scaled on the fly [and the scaling has
  38. improved from texttopbm].
  39.  
  40. As I've never seen a pbm to epson 24 pin converter I enclose one
  41. which I put together some time ago. 
  42.  
  43. How to integrate hp2pbm into faxpak [1.00 and later]
  44. ====================================================
  45.  
  46. The Makefile included creates hp2pbm as a standalone pgm. To have
  47. it integrated into faxpak, insert the following lines at some
  48. appropriate places into faxpak's makefile [no you can't have a 
  49. patch as my makefile is a moving target]:
  50.  
  51.  
  52. HP2PBM =    hpp.o hpfntwrite.o libfax.a
  53.  
  54. LIBPGMS =    spoolfax sendfax faxcleanup texttopbm hp2pbm
  55.  
  56. # programs
  57. hp2pbm:        $(FAXHDR) $(HP2PBM)
  58.         cc -o hp2pbm $(LDFLAGS) $(HP2PBM)
  59.  
  60. # components
  61. hpp.o:        $(FAXHDR) hptopbm.h hpp.c
  62.         cc -c -DFAXPAK $(CFLAGS) hpp.c
  63.  
  64. hpfntwrite.o:    $(FAXHDR) hptopbm.h hpfntwrite.c
  65.         cc -c -DFAXPAK $(CFLAGS) hpfntwrite.c
  66.  
  67. install:
  68.         -ln $(FAXLIBDIR)/hp2pbm $(FAXLIBDIR)/hp2lofax
  69.         -ln $(FAXLIBDIR)/hp2pbm $(FAXLIBDIR)/hp2hifax
  70.         if ( test ! -d $(FAXLIBDIR)/hplib ) then \
  71.             mkdir $(FAXLIBDIR)/hplib ; fi
  72.         cp *sfp $(FAXLIBDIR)/hplib
  73.         cp hppat? $(FAXLIBDIR)/hplib
  74.         cp hprast? $(FAXLIBDIR)/hplib
  75.         chown $(OWNER) $(FAXLIBDIR)/hplib/*
  76.         chgrp $(GROUP) $(FAXLIBDIR)/hplib/*
  77.         chmod 600 $(FAXLIBDIR)/hplib/*
  78.  
  79.  
  80. In fax.h, add to faxtypes[]
  81.  
  82.     "hp",        HPCL,        1,
  83.     "ljet",        HPCL,        0,
  84.     "laser",    HPCL,        0,
  85.     "laserjet",    HPCL,        0
  86.  
  87.  
  88. and in spoolfax.c change hp2pbm() from generating an error message to:
  89.  
  90. hptopbm(base)
  91. char *base;
  92. {
  93.     if (fax.hires)
  94.         sprintf(tmp, "%s/hp2hifax -r %s.%s <%s",
  95.             fc.faxlib,base,PBM_EXT,base);
  96.     else sprintf(tmp, "%s/hp2lofax -r  %s.%s <%s",
  97.         fc.faxlib,base,PBM_EXT,base);
  98.  
  99.     if (system(tmp))
  100.     {
  101.         fax_log(ERROR, "spoolfax/hptopbm(): system(%s) failed\n",tmp);
  102.         return(ERROR);
  103.     }
  104.     unlink(base);
  105.  
  106.     sprintf(tmp, "%s.%s",base,PBM_EXT);
  107.     return(page_count(tmp));
  108. }
  109.  
  110. Add a directory hplib in your faxlib and copy the font and pattern clones 
  111. into faxlib/hplib.
  112.  
  113. If you find bugs in hpfntwrite.c, for which I take all the blame, or
  114. pbm related bugs in hpp.c, please let me know. If you find pbm files
  115. not looking dot for dot [*] what the printed output looks like, it would 
  116. help me to have your input to hp2*. Core dumps are not accepted unless
  117. supplied on the hard disk they were dumped to.
  118.  
  119. [* If the hpcl input to hp2* positions chars or graphics at decipoints
  120. there will be rounding differences. hp2* thinks at 300 dpi resolution
  121. and cannot address fractions of a dot. I don't really know how the ljet
  122. manages this, but as far as I can tell it seems to do it. As the major
  123. use of hp2* will be scaling down to a lower resolution, this doesn't
  124. matter.]
  125.  
  126. hp2*'s operation has been verified using Chris Lewis' psroff test page
  127. which is a challenge and not printed correctly by all hp printer clones.[*]
  128. As soon as it not only survived the test page but also reproduced a bitmap 
  129. dot for dot it sailed through CorelDraw graphics, the "Ventura Printer 
  130. Capabilities Page" and a 40 page TeX document including graphics at 150 dpi
  131. fed through dvijep without even raising an eyelid. Doubtless there are still
  132. many warts to be ironed out [or plucked?] as the hpcl "language" as described
  133. in the printer tech ref manuals seems somewhat ambiguous in several
  134. respects. Quite a bit of the code in hpfntwrite therefore had to be deduced
  135. from how an hp ljet behaves when confronted with combinations of sequences
  136. with little or no documentation.
  137.  
  138.  
  139. [* Some printers are unable to cope with the incremental downloading that
  140. psroff or jetroff are capable of doing.  In the case of psroff, you want
  141. to *undefine* INCR for such printers.  ...CRL]
  142.  
  143. I haven't had a chance yet to test the code relating to printer macros.
  144.  
  145. klaus    <klaus@cnix.uucp>    aug 28th '91
  146.  
  147.  
  148.  
  149. Integration with psroff:
  150.  
  151. If you have faxpak, build hp2pbm according to the above instructions.
  152. Otherwise, just build this software as is.
  153.  
  154. For epson printing, you will want to run:
  155.  
  156.     psroff -Tlj -t <whatever> | hp2e24 file
  157.  
  158. Which will create a series of files called "file.0", "file.1" etc.
  159. Caution: these files can get quite big.
  160.  
  161. Then you run:
  162.  
  163.     for i in file.?
  164.     do
  165.         pbm2e24 $i | <your print spooler>
  166.     done
  167.  
  168. In order to run the other varians of hp2*, you'll have to obtain
  169. other PBM drivers, such as those in faxpak.
  170.  
  171. Chris Lewis    <clewis@ferret.ocunix.on.ca>
  172.