| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
In my PDE I put several key/value pairs in the jobticket, which my CUPS filter then should inject into the PostScript stream.
My first attempt was to read lines from stdin with fgets (and write them to stdout with fputs) until I find a line which starts with "%%EndComments", Here I would inject some PostScript code, write the line itself, then search for "%%EndSetup", inject even more, and afterwards just copy the rest of stdin to stdout.
However, there are Macintosh applications which generate their own PostScript when printing and use 0x0D as newline, not 0x0A which fgets expects. Also fgets cannot deal with binary data since it stops when it reads 0x00. So I changed my code to use fread and fwrite instead.
But I am afraid there might be binary data (e.g. some 15MB japanese font) in the PostScript stream before "%%EndSetup", which by chance could contain the bytes 0x2525456E645365747570 (aka %%EndSetup) - in which case I would inject my PostScript code at the wrong place.
Is this possible at all (binary data before %%EndSetup)?
If yes, since ANY filter should have this problem, does every developer have to write his own full fledged PostScript parser to find the correct injection points or are there any OS routines / library calls which do this?
| References: | |
| >CUPS filter: binary data before %%EndSetup ? (From: Marc Stibane <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.