[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unnaming an LGP2 printer



   Date: Thu, 16 Nov 89 16:56:58 EST
   From: rwtucker@starbase.mitre.org (Richard W. Tucker)

   We borrowed an Apple LaserWriter and used it on a sponsor's Symbolics.
   The print spooler in collusion with the namespace changed the name
   stored in the printer.  This is the name that prints on the top of the
   "test page" when you turn it on.

That's just an annoying misfeature of the spooler and I see no
requirement from the namespace to do so. I've outcommented the method
which does so and our spooler and printer work just fine. Maybe it's
changed in Genera 8?

   The problem is that this name persists when you power cycle the
   LaserWriter, and the original owner of the printer doesn't want the

Yes, it's stored in novolatile parameter RAM inside the LaserWriter.

   So:  Is there a magic way to reset the LaserWriter hardware to its
   factory state without sending it commands through a cable?  If not,
   what incantations on the Sun are suggested?

You may just send him/her (don't know the printer's name ;-) a
Postscript file containing the appropriate code via e.g. lpr. (That's
what the print spooler does too, so you might take a look at the code
in sys:hardcopy;lgp2.lisp) I append some examples (which might be of
interest to all those asking ever so often) for setting and retreiving
various printer parameters via postscript and from the password
setting example at the beginning and the state querying example at the
end you may deduce the way to set the name.

Be careful with setting those parameters to often because the RAM
allows only a few thousand(or was it hundred?) changes before it wears
out. The Laserwriter II NTX is different in that allows as many
changes as you like because it uses different (more expensive)
technology.

Regards, JC

---cut--here-----------------------------------------------------------------
% -*- Mode: PostScript -*-
%
%% Misc maintenance and parameter changing routines for Apple LaserWriters
%
% Note: cut out the part you'll need and "print" it to your printer
% the percent sign is the Postscript comment char



%%------------------------------------------------------------------------
%% Set printer's password

	serverdict begin 0 exitserver
	statusdict begin
	0 417 setpassword
	pstack
	end

%%------------------------------------------------------------------------
%% Toggle start page processing

	serverdict begin 0 exitserver
	statusdict begin
	true setdostartpage
	end

%%------------------------------------------------------------------------
%% Switch baud rate on DB25 port

	serverdict begin 0 exitserver
	statusdict begin
	25 sccbatch
	pstack
	%25 9600 0 setsccbatch			%9600 baud, 0 = ignore parity
	25 19200 0 setsccbatch
	25 sccbatch
	pstack
	end

%%------------------------------------------------------------------------
%% Switch page types

	serverdict begin 0 exitserver
	userdict begin
	   /letter 0 def
	   /legal 2 def
	   /a4 3 def
	   /b5 4 def
	   /lettersmall 5 def
	   /a4small 6 def
	   /note 7 def

	   statusdict begin
	      a4 setpagetype
	   end
	end

%%------------------------------------------------------------------------
%% Hardcopy printer parameters

	userdict begin
	/fontsize 12 def
	/Courier findfont fontsize scalefont setfont
	/lmargin 72 def
	/tabwidth 80 def
	/newline
	   {currentpoint exch pop lmargin exch moveto	%carriage return
	    0 fontsize neg rmoveto}			%line feed
	def
	/tab
	   {currentpoint exch
	    lmargin sub
	    tabwidth div 1 add ceiling tabwidth mul
	    lmargin add
	    exch moveto}
	def
	/str 20 string def
	/mshow
	   {str cvs show}
	def

	statusdict begin
	   %lmargin 500 moveto
	   lmargin 720 moveto
	   (Printer:) show	tab str printername show newline
	   newline
	   (PS Version:) show 	tab version show newline
	   (Product:) show 	tab product show newline
	   (Revision:) show 	tab revision mshow newline
	   newline
	   (Start Page:) show 	tab dostartpage mshow newline
	   (Page Count:) show 	tab pagecount mshow newline
	   (Baud:) show 	tab 25 sccbatch exch mshow
				(, parity ) show mshow newline
	   (Pagetype:) show	tab pagetype mshow newline
	   (Margins:) show	tab margins (left=) show mshow ( top=) show mshow
	   newline
	   showpage
	   end
	end

%%========================================================================EOF.