RolandTheRoadie
Programmer
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.
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.