Is "runEPS: Not DSC" a problem?
Yu Guo
Victor.Yu.Guo at gmail.com
Tue Sep 26 14:12:13 PDT 2006
> Yu Guo wrote:
> > ...
> > I also tried to print the raster data into a file, the output is
> > still not correct (it is not what I want to print).
>
> What is wrong about it?
>
> --
> ______________________________________________________________________
> Michael Sweet, Easy Software Products mike at easysw dot com
> Internet Printing and Publishing Software http://www.easysw.com
I think I may ask my question in another way in order to slove the problem.
My printer only accepts normal ASCII text as input. But I would like to print more format than text such as PDF or PS.
So I think I could use the raster filter to convert the PS to raster data and write a driver to convert raster data into the printer's language.
So the basic question would be :
Is it possible to convert raster data in to normal ASCII text?
I wrote some code like this to convert:
......
ras = cupsRasterOpen(fd, CUPS_RASTER_READ);
while (cupsRasterReadHeader(ras, &header))
{
//prepare buffer
StartPage(ppd, &header);
for (y = 0; y < header.cupsHeight; y ++)
{
if(cupsRasterReadPixels(ras, Buffer, header.cupsBytesPerLine) < 1)
break;
//print a line to printer
fwrite(Buffer,(int)(header.cupsWidth + 7) / 8, 1 , stdout);
//print a line to debug file
fwrite(Buffer,(int)(header.cupsWidth + 7) / 8, 1 , debug_fp);
}
//free buffer
EndPage();
}
......
But it does not work even for the normal text file.
I tried to print a text file containing only this line: "This is raster test - 25-09-06!"
But what I got from the output is not like the input and not human readable.
There are some information from the code and the printing:
In StartPage: Size of buffer: 48
PAGE: page: 1 ; number of copy:1
cupsHeight: 591
cupsWidth: 384
(cupsWidth+7)/8: 48
Therefore, if the raster data can be converted into normal text, the second question would be:
What can I do to translate the raster data into normal text?
Thank you for the help very much!!!
YuGuo
More information about the cups-devel
mailing list