home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume26 / hp2pbm / part01 / README < prev   
Encoding:
Text File  |  1991-12-11  |  5.6 KB  |  170 lines

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