Bug 41582 - [PATCH] New component: PostScript DSC parser
Summary: [PATCH] New component: PostScript DSC parser
Status: RESOLVED FIXED
Alias: None
Product: XMLGraphicsCommons - Now in Jira
Classification: Unclassified
Component: postscript (show other bugs)
Version: Trunk
Hardware: All All
: P2 enhancement (vote)
Target Milestone: --
Assignee: XML Graphics Project Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2007-02-09 03:21 UTC by Jeremias Maerki
Modified: 2007-02-28 08:49 UTC (History)
0 users



Attachments
The patch with the new DSC parser/processor (192.12 KB, patch)
2007-02-09 03:29 UTC, Jeremias Maerki
Details | Diff
PGP Signature for the patch file (216 bytes, text/plain)
2007-02-09 03:30 UTC, Jeremias Maerki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremias Maerki 2007-02-09 03:21:15 UTC
(adding this for IP clearance tracking)

Description of the contribution:

DSC parser/processor

Many PostScript files use special comments to structure a document. This
allows manipulation of PostScript files without interpreting them. These
special comments are defined in the Document Structuring Conventions.
http://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf
The code in Commons is designed to work with DSC 3.0. For details on how
DSC is used, please take a look at the DSC specification.

The DSC support in Commons was primarily developed to implement resource
optimization features in Apache FOP's PostScript output support.
Resources like images which are used repeatedly in a document should not
be written to the PostScript file each time it is used. Instead it is
written once at the beginning of the file as a PostScript form. The form
is then called whenever the image needs painting.

But the DSC parser could potentially be used for other purposes. The
most obvious is extracting a subset of pages from a DSC-compliant file.
Assume you want to print only page 45 to 57 of a particular document.
There's an example that demonstrates exactly this. Check out the
"examples" directory in the distribution. Other potential use cases for
the DSC parser are:

    * Patching PostScript files, for example, adding OMR marks for automatic
packaging
    * Imposition (2-up, n-up, rotation, etc.)
    * EPS graphic extraction
    * Inspecting the page count
    * etc. etc.

The DSC parser (DSCParser) was designed as a pull parser, i.e. you fetch
new events from the parser inspecting them and acting on them as they
are found. If you prefer to work with a push parser, you can pass the
DSCParser a DSCHandler implementation and the parser will send you all
the events.

The best example to understand how to use the DSC parser is the
PageExtractor class that implements the page extraction functionality
mentioned above.
Comment 1 Jeremias Maerki 2007-02-09 03:29:09 UTC
Created attachment 19559 [details]
The patch with the new DSC parser/processor
Comment 2 Jeremias Maerki 2007-02-09 03:30:06 UTC
Created attachment 19560 [details]
PGP Signature for the patch file
Comment 3 Jeremias Maerki 2007-02-28 08:47:13 UTC
Grant has been submitted and recorded. IP Clearance is filed:
http://incubator.apache.org/ip-clearance/xmlgraphics-commons-postscript-dsc-parser.html

Patch applied.
Comment 4 Jeremias Maerki 2007-02-28 08:49:07 UTC
Commit: http://svn.apache.org/viewvc?view=rev&rev=512838