[comp.lang.postscript] Need way to select HP LaserJet emulation

friedl@mtndew.UUCP (Steve Friedl) (02/18/90)

Hi folks,

     I have a Dataproducts LZR 1260 here at the house, and it's
got the HP LaserJet emulation in it.  I mostly run in PS batch,
but there are some packages that I have that simply prefer the HP
mode.  I can change this from the front-panel, but I would love
very much to be able to do it from software so I can add an lp
spooler option to control it.  Furthermore, I don't want to burn
a hole in my EEROM everytime I change modes.  This is getting
tiring.

     I did some digging around and found "inithplj" and "hplj"
operators in statusdict, and this strikes me as going in the
right direction.  "hplj" does just about the right thing, except
that CR/LF is not treated quite right.  When I run "inithplj", I
am told that it is unregistered (what is this anyway?)

     Amanda pointed me to "setsccstreams" and "transparent" mode,
but even after getting _Inside PostScript_ it is clear that I am
wallowing in this stuff and it will take me a very long time to
figure it out on my own.  I am not even convinced that any of
this scc stuff applies to the parallel port.

     Does anybody have any idea how I can run this hp mode called
from PS batch?  With an eight-bit interface? (I need to download
soft fonts)  I understand that this is not supported by Adobe so
nothing is guaranteed to last, but I think this is fair game for
an lp interface program to know about.

     For what it's worth, a customer has a QMS PS 800 II on which
I wish to do the same thing.  This printer also has Diablo and HP
GL emulations which might be nice to call in a similar way.

     Thanks for the help,
     Steve

P.S. - Amanda, thanks for the pointers....

-- 
Stephen J. Friedl, KA8CMY / Software Consultant / Tustin, CA / 3B2-kind-of-guy
+1 714 544 6561 voice   /   friedl@vsi.com   /   {uunet,attmail}!mtndew!friedl

"Winning the Balridge Quality Award is as easy as falling off a horse." - me

woody@rpp386.cactus.org (Woodrow Baker) (02/19/90)

In article <347@mtndew.UUCP>, friedl@mtndew.UUCP (Steve Friedl) writes:
> Hi folks,
> 
> 
>      I did some digging around and found "inithplj" and "hplj"
> operators in statusdict, and this strikes me as going in the
> right direction.  "hplj" does just about the right thing, except
> that CR/LF is not treated quite right.  When I run "inithplj", I
> 
> figure it out on my own.  I am not even convinced that any of
> this scc stuff applies to the parallel port.

it does not.

Following is some code that I wrote and sold to a client.  I also
used it to gain a dual sale of PS-800II's as you cannot switch
the paper trays under hp mode.  This code found it's way into a 
commercial product, but I never sold the exclusive rights to it.
here it is, and hope it helps.

 
% downloaded routine to allow tray switching on the
% ps-800II printer
% to use, print this to the printer.  The printer will load
% this in and it will stay in the printer until the power is turned
% off.  If you are typing it in, use a texteditor that will allow
% you to embed the ESC character, or use the basic version to create
% a file.  It is used by sending an *E to start the HPLJ emulator
% you must then send an ESC &k3G to enable cr/lf's to work correctly
% with the HP emulation.  To Exit the emulation, you send an escape
% sequence.  The sequence is 27 7f 04.  The 04 by it's self will also
% work.  That forces an end of job.  Then to switch trays, you send
% the normal escape sequence of  ESC l1H and ESC l0H  Where ESC is
% chr$(27) or 1B.  This will cause the papertray to switch and then
% restart the emulation.  The only caveat is that ^C, ^T,^S,^Q and ^D
% cannot be included in the character stream.  This version does NOT
% put the machine in transparent i/o mode.  If you are using a PARALELL
% interface, it will be in transparent i/o mode.
% You MUST put a space in front of and after the trayswitch commands.
%
% The character ^D will cause the current emulation to be terminated
% on the spot.  The printer will kickout a page.  The ^C command will
% cause the job to terminate, but will NOT kick the page out.  This will
% let you embed POSTSCRIPT code and use postscript code to do what
% you want.  You can then restart the emulator.
%
serverdict begin statusdict begin 0 exitserver
 
/*E                %change this if you want
        {
        serverdict begin statusdict begin
        hplj                              %start HP emulation.
        } def
%
% substitute binary 0x1b, (enter it in binary in the file) for 
% the # in the next 2 routines.....>
%

/#l10H
	{
	statusdict begin 1 setpapertray end
	serverdict begin statusdict begin
	hplj
	}def

/#l11H
	{
	statusdict begin 2 setpapertray end
	serverdict begin statusdict begin
	hplj
	} def

%----------------------------

An examination of serverdict and statusdict led to the understanding that
the HP emulation used the default paper tray, rather than obeying the rules
and using the user tray.  So, rather than allowing the normal invocation
to happen, we bypass it, such that we can force the tray to what we want.
When the sequence  <space><ESC>l10H<space> is seen, the proceedure above
executes.  To use this in a document, first switc to HP mode with *E,
then when you want to change paper trays, send a ^d.  This drops you into
postscript.  Send the above escape sequence, and it will change trays and
drop you back into hp mode....

Cheers
Woody