| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
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.
If you need to parse for arbitrary DSC comments such as %%EndSetup you should always be parsing for the sequence:
<newline>%%EndSetup<newline>
where <newline> can be <cr>, <lf> or <crlf>
Since DSC comments always appear after a newline (or with the %!PS-Adobe-xx which is the first sequence in the file), this is a better approach.
If you need to make a feature or features available for your printer that require collecting data from the user beyond hard coded features that can be well described by the standard PPD syntax you can have your PPD describe a feature that causes invocation code to be added to the print stream that you can parse for in your filter.--snip--
You should have a pretty easy time parsing for this sequence and perform the appropriate replacement in your filter. This should make your filter's job significantly easier and avoid the general parsing difficulties you might otherwise encounter.
| References: | |
| >CUPS filter: binary data before %%EndSetup ? (From: Marc Stibane <email@hidden>) | |
| >Re: CUPS filter: binary data before %%EndSetup ? (From: David Gelphman <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.