[comp.lang.postscript] Using readstring with the image operator

rsmith@well.sf.ca.us (Ross Smith) (03/13/90)

To save time and space, I'm trying to transmit binary data to a
PostScript interpreter using readstring instead of readhexstring
in conjunction with the image operator.

Problems start if the binary data contains a ^C (control-C), ^D,
^J, or ^T.  The interpreter apparently ignores (throws away) a
^C, ^J and ^T, and sees a ^D as an end-of-job indicator, thereby
stopping the current job.

On page 12 of Adobe's "PostScript Language Color Extensions" is an
example of using readstring with the image operator.  Unfortunately,
the example is for an interpreter that has a file system.

I know there is a solution as a PostScript printer in HP LaserJet
emulation mode can ignore control-d's at certain times
(when you download a font for example).

Here's an example of what I want to do:

/str 5 string def
72 72 translate
72 72 scale
5 5 8
[5 0 0 5 0 0]
{currentfile str readstring pop} bind
image
^@^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^R^S^T^U^V^W^X % (25 bytes of binary data)
showpage

Does anybody have any ideas on how to get around this problem?  Any help
would be appreciated.

Please forgive my previous posting as this is the first time I have posted
news.  It won't happen again.  Promise!

-- 
Ross Smith  rsmith@well.sf.ca.us   {apple,pacbell,hplabs,ucbvax}!well!rsmith

woody@chinacat.Lonestar.ORG (Woody Baker @ Eagle Signal) (03/14/90)

In article <16667@well.sf.ca.us>, rsmith@well.sf.ca.us (Ross Smith) writes:
> 
> Problems start if the binary data contains a ^C (control-C), ^D,
> ^J, or ^T.  The interpreter apparently ignores (throws away) a
> ^C, ^J and ^T, and sees a ^D as an end-of-job indicator, thereby
> stopping the current job.

Apparently some of these are not stopped by appletalk or the paralell port.
Short of a re-do of the serial port control software in the printer, there
is not much you can do.  This is one of my pet peeves about postscript.
The reason that the hplaserjet emulation works is that it has a special
mode that it uses.  I don't know which printer you have, but in general
it won't work.

> 
> 
> 


You will find that CR  also get lost, cooked to LF's.....
Cheers
Woody