[cups.development] How to find out end of file in raster format

Michael Sweet msweet at apple.com
Mon Dec 7 10:59:45 PST 2009


On Dec 7, 2009, at 8:51 AM, solomon wrote:
> ...
>  I tried with the above code but it's not breaking when the end of file is reached, it's printing white space as much as cups.Height which i mentioned in ppd file.

OK, CUPS has no notion of a automatic-variable-length page - you need to specify the actual page length when you submit the print job and CUPS (and the corresponding RIP filter - cgpdftoraster or pstoraster) will generate raster data of that height.

> ...
> what should i do?

The best you could do is always take full-length page and then look for blank lines in the raster data - when you see blank lines, just start counting them and if all that remains on the current page are blanks then you don't need to send anything else to the printer, otherwise you send however many blank lines to the printer followed by the next non-blank content.

___________________________________________________
Michael Sweet, Senior Printing System Engineer







More information about the cups-devel mailing list