[comp.lang.postscript] how to send binary images to LaserWriter ?

nguyensh@latcs1.oz.au (Si-Hanh Nguyen) (05/07/90)

Does anybody know how to send images in binary (instead of hex)
to LaserWriter (using operators image and imagemask) ?

Most of our jobs, 90% of PostScript source are image in hexadecimal.
We would like to double speed by using binary image. 
(Yes, increasing baud rate is another way...)

The printer is Apple LaserWriter, serial, 9600 bauds.

Any help will be greatly appreciated.


Si-Hanh Nguyen
------------------
nguyensh@latcs1.oz
------------------

shn@allgfx.agi.oz (Si-Hanh Nguyen) (05/08/90)

In article <7788@latcs1.oz.au> nguyensh@latcs1.oz.au (Si-Hanh Nguyen) writes:
> Does anybody know how to send images in binary (instead of hex)
> ...
> The printer is Apple LaserWriter, serial, 9600 bauds.
> ...
> Si-Hanh Nguyen

I would like to add some more info. to my yesterday posting.

I am trying to find a way to send 8-bit transparent data over the 
serial line, from a Sun 3/50 to an Apple LaserWriter. The reason 
is I would like to send image in binary instead of in hexadecimal.
The problem is images in binary form contains control characters 
such as ^D, ^C, ^T  which have special meanings to the LaserWriter.

The "transparent" boolean is mentioned in "Inside PostScript, Frank 
Merritt Braswell, Systems of Merit & Peachpit Press  1989", page 13-5. 
If its value is TRUE then the serial chanel is opened in transparent 
mode. I test the folllowing code, it does not work, ^T is still 
intepreted as a query :


% begin test
serverdict begin 0 exitserver	    % have to exit server
serverdict /transparent true put    % to modify serverdict
300 400 translate 72 72 scale 	    % 
8 8 1 [8 0 0 8 0 0] { (^T0) } 	    % image in binary
image 				    
showpage
%end test


Has anybody tried that /transparent before ?
And any help in 8-bit transparent data will be greatly appreciated.


Si-Hanh Nguyen
----------------------------------------------------
nguyensh@lastcs1.oz	OR	shn@allgfx.agi.oz.au
----------------------------------------------------

woody@chinacat.Unicom.COM (Woody Baker @ Eagle Signal) (05/09/90)

In article <1990May8.065455.23290@allgfx.agi.oz>, shn@allgfx.agi.oz (Si-Hanh Nguyen) writes:
> 
> I am trying to find a way to send 8-bit transparent data over the 
> serial line, from a Sun 3/50 to an Apple LaserWriter. The reason 
> is I would like to send image in binary instead of in hexadecimal.
> The problem is images in binary form contains control characters 
> such as ^D, ^C, ^T  which have special meanings to the LaserWriter.
> 

Yep, this is one of my gripes.  I understand however, that the APPLETALK
channel will do this.  If you have a Paralell port on the laserprinter, it
might work.  Generaly, you are out of luck.  Adobe in thier *INFINITE 
WISDOM* messed everyone up for whatever reason.


> The "transparent" boolean is mentioned in "Inside PostScript, Frank 
> Merritt Braswell, Systems of Merit & Peachpit Press  1989", page 13-5. 
> If its value is TRUE then the serial chanel is opened in transparent 
> mode. I test the folllowing code, it does not work, ^T is still 
> intepreted as a query :

Yes it will not work.  This is printer or statusdict dependant.  I have
used it, and it works, but you lose control of the machine.  The boolean
transparent is used in one of the serial channel commands that are not
documented.  If you examine your serverdict and statusdict, you will
find out just how it is used (providing you have a PARALELL interface,
or HP Laserjet emulation)

You can do this by first getting into interactive mode (use a terminal
emulation program and type in    executive

you should be greeted with a PS> prompt.
then turn on your ascii screen file capture, and do the following

statusdict begin serverdict begin
/statusdict load {== ==} forall
/serverdict load {== ==} forall


You will be looking for a procedure array named exeswitch or something
along those lines.  Look for the code that starts the HP emulation, or
Paralell mode.  I think that the Diablo mode might also invoke it.
Copy the example.

Cheers
Woody
> 
> 
> % begin test
> serverdict begin 0 exitserver	    % have to exit server
> serverdict /transparent true put    % to modify serverdict
> 300 400 translate 72 72 scale 	    % 
> 8 8 1 [8 0 0 8 0 0] { (^T0) } 	    % image in binary
> image 				    
> showpage
> %end test
> 
> 
> Has anybody tried that /transparent before ?
> And any help in 8-bit transparent data will be greatly appreciated.
> 
> 
> Si-Hanh Nguyen
> ----------------------------------------------------
> nguyensh@lastcs1.oz	OR	shn@allgfx.agi.oz.au
> ----------------------------------------------------

jacob@gore.com (Jacob Gore) (05/09/90)

/ comp.lang.postscript / shn@allgfx.agi.oz (Si-Hanh Nguyen) / May  8, 1990 /
> The problem is images in binary form contains control characters 
> such as ^D, ^C, ^T  which have special meanings to the LaserWriter.

Would it be hard to write uudecode in Postscript?

Jacob
--
Jacob Gore		Jacob@Gore.Com			boulder!gore!jacob