Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with ioerror in readstring

Status
Not open for further replies.

RolandTheRoadie

Programmer
Jan 5, 2005
7
US
I am trying to print a JPG image on a Level 2 printer by using a form that reads the data with a data acquisition procedure. When I view the file through and interpreter (Ghostscript), the program displays fine. My problem is when I send this file to the printer, I receive the following error:
ERROR: ioerror
OFFENDING COMMAND: readstring

STACK:

(

)
filetype --nostringval--
/Imagedata



If anyone could offer any insight as to why this works in one place but not another, I would greatly appreciate it. Below is the code I am using that attempts to print the image

%!

/CreateDataArray
{
/temp exch def
[
{
temp 4096 string readstring
not { exit } if
} loop
dup length 0 eq { pop } if
]
} bind def


% Create an array of strings, reading data from currentfile
/ImageData
currentfile /ASCIIHexDecode filter /DCTDecode filter CreateDataArray

%% Hex Data Omitted

def

/JumpForm <<
/FormType 1
/BBox [ 0 0 85 20 ]
/Matrix [ 1 0 0 1 0 0 ]

/PaintProc
{
pop
userdict /i 0 put
/DeviceRGB setcolorspace
85 20 scale
<<
/ImageType 1
/Width 85
/Height 20
/BitsPerComponent 8
/ImageMatrix [ 85 0 0 -20 0 20 ]
/DataSource {
ImageData i get
/i i 1 add store
} bind
/Decode [ 0 1 0 1 0 1 ]
>> image
} bind
>> def


JumpForm execform
0 219 translate
JumpForm execform

showpage


Thanks in advance for any help you can offer.
 
Just to update anyone that's interested....

The problem was that the jpg file I was using was apparently corrupted. I can't tell you why Ghostscript was able to overcome the problem, and the printer wasn't, but I tried the same code with a couple of different images, and it worked great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top