home *** CD-ROM | disk | FTP | other *** search
- HP2PBM et. al.
- Version 1.00
- Chris Lewis <clewis@ferret.ocunix.on.ca>
- Klaus Schallhorn <klaus@cnix.uucp>
- [README V1.1]
-
- The first section of this README is a discussion of how you
- integrate this package with faxpak, the second half is how
- to integrate with psroff.
-
- Introduction and FAXPAK:
-
- hp2* being a number of programs with a number of uses is somewhat
- difficult to explain.
-
- I bolted this together basically to have a filter from HPCL escape
- sequences to fax. Without Chris Lewis' hpinterp.c, which does the
- parsing of escape sequences, I probably wouldn't have started this.
- Using Chris' parser and a few routines I borrowed from faxpak and
- some earlier code I wrote hp2* in a few evening hours. I also spent
- some time creating two "built in" fonts and all the built in pattern
- and raster clones my antique hp ljet plus knows about.
-
- hp2pbm is an integrated part of faxpak. hp2pbm is not yet an integrated
- part of psroff, but will be in future.
-
- Some of the things you can do with hp2*:
-
- psroff -Tlj -t <files> | fax phone -type hp
- jetroff | fax phone -type hp
- CorelDraw | hp2e24 | pbmtoe24 | lpr -d mytrustedepsonprinter
- psroff -Tlj -t <files> | hp2e24 | pbm2e24 | lpr -d epson
- TeX | dvijep | fax -type hp
-
- Yes, strangely enough faxpak now supports two routes from TeX to fax,
- one which requires dvitopbm and a huge assortment of pk fonts in low
- and high fax resolution, and the one made possible by hp2* where fonts
- "downloaded" by dvijep are scaled on the fly [and the scaling has
- improved from texttopbm].
-
- As I've never seen a pbm to epson 24 pin converter I enclose one
- which I put together some time ago.
-
- How to integrate hp2pbm into faxpak [1.00 and later]
- ====================================================
-
- The Makefile included creates hp2pbm as a standalone pgm. To have
- it integrated into faxpak, insert the following lines at some
- appropriate places into faxpak's makefile [no you can't have a
- patch as my makefile is a moving target]:
-
-
- HP2PBM = hpp.o hpfntwrite.o libfax.a
-
- LIBPGMS = spoolfax sendfax faxcleanup texttopbm hp2pbm
-
- # programs
- hp2pbm: $(FAXHDR) $(HP2PBM)
- cc -o hp2pbm $(LDFLAGS) $(HP2PBM)
-
- # components
- hpp.o: $(FAXHDR) hptopbm.h hpp.c
- cc -c -DFAXPAK $(CFLAGS) hpp.c
-
- hpfntwrite.o: $(FAXHDR) hptopbm.h hpfntwrite.c
- cc -c -DFAXPAK $(CFLAGS) hpfntwrite.c
-
- install:
- -ln $(FAXLIBDIR)/hp2pbm $(FAXLIBDIR)/hp2lofax
- -ln $(FAXLIBDIR)/hp2pbm $(FAXLIBDIR)/hp2hifax
- if ( test ! -d $(FAXLIBDIR)/hplib ) then \
- mkdir $(FAXLIBDIR)/hplib ; fi
- cp *sfp $(FAXLIBDIR)/hplib
- cp hppat? $(FAXLIBDIR)/hplib
- cp hprast? $(FAXLIBDIR)/hplib
- chown $(OWNER) $(FAXLIBDIR)/hplib/*
- chgrp $(GROUP) $(FAXLIBDIR)/hplib/*
- chmod 600 $(FAXLIBDIR)/hplib/*
-
-
- In fax.h, add to faxtypes[]
-
- "hp", HPCL, 1,
- "ljet", HPCL, 0,
- "laser", HPCL, 0,
- "laserjet", HPCL, 0
-
-
- and in spoolfax.c change hp2pbm() from generating an error message to:
-
- hptopbm(base)
- char *base;
- {
- if (fax.hires)
- sprintf(tmp, "%s/hp2hifax -r %s.%s <%s",
- fc.faxlib,base,PBM_EXT,base);
- else sprintf(tmp, "%s/hp2lofax -r %s.%s <%s",
- fc.faxlib,base,PBM_EXT,base);
-
- if (system(tmp))
- {
- fax_log(ERROR, "spoolfax/hptopbm(): system(%s) failed\n",tmp);
- return(ERROR);
- }
- unlink(base);
-
- sprintf(tmp, "%s.%s",base,PBM_EXT);
- return(page_count(tmp));
- }
-
- Add a directory hplib in your faxlib and copy the font and pattern clones
- into faxlib/hplib.
-
- If you find bugs in hpfntwrite.c, for which I take all the blame, or
- pbm related bugs in hpp.c, please let me know. If you find pbm files
- not looking dot for dot [*] what the printed output looks like, it would
- help me to have your input to hp2*. Core dumps are not accepted unless
- supplied on the hard disk they were dumped to.
-
- [* If the hpcl input to hp2* positions chars or graphics at decipoints
- there will be rounding differences. hp2* thinks at 300 dpi resolution
- and cannot address fractions of a dot. I don't really know how the ljet
- manages this, but as far as I can tell it seems to do it. As the major
- use of hp2* will be scaling down to a lower resolution, this doesn't
- matter.]
-
- hp2*'s operation has been verified using Chris Lewis' psroff test page
- which is a challenge and not printed correctly by all hp printer clones.[*]
- As soon as it not only survived the test page but also reproduced a bitmap
- dot for dot it sailed through CorelDraw graphics, the "Ventura Printer
- Capabilities Page" and a 40 page TeX document including graphics at 150 dpi
- fed through dvijep without even raising an eyelid. Doubtless there are still
- many warts to be ironed out [or plucked?] as the hpcl "language" as described
- in the printer tech ref manuals seems somewhat ambiguous in several
- respects. Quite a bit of the code in hpfntwrite therefore had to be deduced
- from how an hp ljet behaves when confronted with combinations of sequences
- with little or no documentation.
-
- [* Some printers are unable to cope with the incremental downloading that
- psroff or jetroff are capable of doing. In the case of psroff, you want
- to *undefine* INCR for such printers. ...CRL]
-
- I haven't had a chance yet to test the code relating to printer macros.
-
- klaus <klaus@cnix.uucp> aug 28th '91
-
- Integration with psroff:
-
- If you have faxpak, build hp2pbm according to the above instructions.
- Otherwise, just build this software as is.
-
- For epson printing, you will want to run:
-
- psroff -Tlj -t <whatever> | hp2e24 file
-
- Which will create a series of files called "file.0", "file.1" etc.
- Caution: these files can get quite big.
-
- Then you run:
-
- for i in file.?
- do
- pbm2e24 $i | <your print spooler>
- done
-
- In order to run the other varians of hp2*, you'll have to obtain
- other PBM drivers, such as those in faxpak, or in PBM+.
-
- Chris Lewis <clewis@ferret.ocunix.on.ca>
-