From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM" 10-MAY-1993 18:30:37.26
To:	EVERHART
CC:	
Subj:	RE: HP Laserjet Library needed

Message-Id: <9305091350.AA01574@uu3.psi.com>
Date: Sun,  9 May 93 09:50:11 EDT
From: Jerry Leichter <leichter@lrw.com>
To: INFO-VAX@kl.sri.com
Subject: RE: HP Laserjet Library needed
X-Vms-Mail-To: UUCP%"cm415a31@socrates.umd.edu"

	Sorry if this question has been asked before,

Many times.  But there doesn't seem to be any place you can quickly pick up
the answer.

	Does anyone known where I might be able to pickup a printer device
	control library for a HP laserJet.

Here's a response I put together quite some time ago.  It works on my
LaserJet+, now four generations out of date.  I've heard from people who've
successfully used it on LaserJet II's, and I'm sure it'll work on more recent
LaserJet's as well.  (The font cartridge hasn't been needed since the II.)

**************
	--------------Command file to start up printer------------

Notes:	(a) These setups assume you have your printer attached to TTA0.
		Change the second line - the definition of SYS$LASERJET -
		if that's not the case.
	(b)  If the terminal port you are using has a speed other than
		19200 bps, change the set terminal command (third line)
		as appropriate for your system.  If your interface can
		manage it, I recommend using 19200 bps - my impression is
		that the resulting performance is better, though the
		difference is by no means huge.
	(c)  The queue initialization assumes that you have placed the setup
		modules in file SYS$LIBRARY:LASERJETLIB.TLB.

$ set noon
$ define/system/exec/translation:terminal SYS$LASERJET TTA0:
$ set terminal SYS$LASERJET/perm/nobroadcast/notypeahead/nowrap -
        /speed=19200/width=80/page=0/device_type=unknown
$ set device /spooled=(SYS$PRINT,SYS$SYSDEVICE:) SYS$LASERJET
$ initialize/queue/start/lib=laserjetlib/separate=(reset=reset) -
        /on=SYS$LASERJET/default=(flag,form=portrait) SYS$PRINT
$ define/form/stock=default portrait 1 /desc="Portrait Courier" -
        /setup=(portrait) /length=60/wid=80/margin=(bottom=0)/wrap/notrunc
$ define/form/stock=default landscape 2 /desc="Landscape"/setup=(landscape) -
        /length=45/wid=132/margin=(bottom=0)/wrap/notrunc
$ define/form/stock=default compressed 3 /desc="Compressed Portrait" -
        /setup=(compressed) /length=80/wid=120/margin=(bottom=0) -
        /wrap/notrunc
$ define/form/stock=default clandscape 4 /desc="Compressed Landscape" -
        /setup=(clandscape) -
        /length=64/wid=176/margin=(bottom=0)/wrap/notrunc

	----------------------Setup modules-----------------------

Notes:  (a) Each SETUP module should contain exactly one line; I have broken
		several into two lines to avoid mailer problems.
	(b) Replace all occurences of <ESC> by an ESCAPE character before
		using;
	(c) CLANDSCAPE uses an 8.5-point, 16.66-pitch line printer font that
		is not in the standard LaserJet; I have it on a cartridge,
		number 92286B.  I believe it comes standard on a LaserJet II
		(along, perhaps, with some other fonts, for which you could
		write your own setup modules).
	(d) All the exact values shown below have been "tuned" to go with the
		exact form defintions given above.  They reset spacing to make
		the output look good to my eye.  THEY ASSUME 8.5 x 11 INCH
		PAPER; you'll have to play around with them to get other paper
		sizes to work.  The symptom of a paper size mismatch is sim-
		ple:  The print symbiont will not properly track where top of
		page is, and output on successive pages will wander all over
		the sheet.  In theory, this dependency can be lessened by
		adding /form to the set terminal command given above, in which
		case the symbiont should send an actual form feed, rather than
		using linefeeds for positioning.  I haven't tried this, so I
		don't know if it will actually work.
	(e) All the values have been wrapped in ANSI DCS sequences (i.e.,
		ESC P ... ESC \).  The LaserJet will ignore both ESC P and
		ESC \, but the result is to make the LaserJet commands
		"invisible" to the VMS print symbiont.  This supresses one
		of the two blank pages you otherwise get between jobs.  I
		haven't been able to find a way to supress the other.
	(f) For best results, follow this rule when printing:

		    Use PRINT/PASSALL for "binary" files - e.g., converted
			TeX DVI files, graphics files.
		    Use PRINT[/NOPASSALL] (the default) for "normal"
			ASCII files.

	(g) All this stuff applies to an HP LaserJet+.  I have not tried it
		on a straight LaserJet, nor on a LaserJet II.  (I've gotten
		confirmation that it works right from another site with a
		LaserJet II, however.)

---------------RESET.TXT-----------------
<ESC>P<ESC>E<ESC>\
---------------CLANDSCAPE.TXT----------------
<ESC>P<ESC>E<ESC>&l1O<ESC>&l63F<ESC>(8U<ESC>(s0p16.66h8.5v0s-3b0T
<ESC>&l5.6470C<ESC>\
---------------COMPRESSED.TXT----------------
<ESC>P<ESC>E<ESC>&l0O<ESC>&a5l80M<ESC>&a0R<ESC>&l8D<ESC>&l80F
<ESC>(8U<ESC>(s0p16.66h8.5v0s0b0T<ESC>\
---------------LANDSCAPE.TXT-----------------
<ESC>P<ESC>E<ESC>&l1O<ESC>&l55F<ESC>(8U<ESC>(s0p10h12v0s0b3T<ESC>\
---------------PORTRAIT.TXT------------------
<ESC>P<ESC>E<ESC>&l0O<ESC>&a5180M<ESC>&a0R<ESC>&l60F<ESC>(8U
<ESC>(s0p10h12v0s0b3T<ESC>&k11.4286H<ESC>&a4L<ESC>\
----------------------------------------------
**************

Below are some alternative definitions once posted to INFO-VAX by Warner Losh.
I've used them in the past, simultaneously with the definitions above, but
find I rarely need them.  (They've been modified to be usable together with
the above definitions.  I don't seem to have Mr. Losh's original version any
more.)  They are NOT wrapped in <ESC>P - <ESC>\ sequences so may produce an
extra blank page of output.

---------------BIND.TXT---------------
<ESC>&l0O<ESC>(8U<ESC>(s0p16.66h8.5v0s0b0T<ESC>&l8D<ESC>&a15L
---------------COMPRESS.TXT---------------
<ESC>&l0O<ESC>(8U<ESC>(s0p16.66h8.5v0s0b0T<ESC>&l8D<ESC>9
---------------HEADER.TXT---------------
<ESC>&a10h0V<ESC>*c5700h5v0P<ESC>&a10h180V<ESC>*c0p5h180V<ESC>&a0h0V<ESC>*c0p
<ESC>&a5700h0V<ESC>*c0P<ESC>&a10h0V<ESC>*c5690h180v20g2P<ESC>&a100h110V
---------------FORMS.COM---------------
$!+
$!   Form definitions.  Removed from PrintQue.Com on 14-Aug-1987
$! by M. Warner Losh.
$!-
$!+
$! Tell the user we're installing the forms.
$!-
$ ECHO "Installing the system forms."
$ DEFINE/FORM/DESCRIPTION="Normal printing"/LENGTH=66/WIDTH=80 -
	/SETUP=RESET/STOCK=DEFAULT DEFAULT_LOSH 100
$ DEFINE/FORM/DESCRIPTION="Compressed output"/LENGTH=82/WIDTH=132 -
	/PAGE_SETUP=COMPRESS/STOCK=DEFAULT COMPRESS_LOSH 101
$ DEFINE/FORM -
	/DESCRIPTION="Bind with header" -
	/LENGTH=82 -
	/WIDTH=132 -
	/SETUP=RESET -
	/PAGE_SETUP=(BIND,HEADER) -
	/STOCK=DEFAULT -
	/MARGIN=(BOTTOM=3) -
	BIND_WITH_HEADER 102
$ DEFINE/FORM -
	/DESCRIPTION="Compressed output with margin" -
	/LENGTH=82 -
	/WIDTH=117 -
	/PAGE_SETUP=BIND -
	/STOCK=DEFAULT -
	BIND 103
**************

Good luck!
							-- Jerry

