Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!natinst!rpp386!woody From: woody@rpp386.cactus.org (Woodrow Baker) Newsgroups: comp.lang.postscript Subject: Re: Need way to select HP LaserJet emulation Summary: here we go... Message-ID: <17976@rpp386.cactus.org> Date: 19 Feb 90 01:54:53 GMT References: <347@mtndew.UUCP> Organization: River Parishes Programming, Plano, TX Lines: 86 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 l10H 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