Return-Path: Delivered-To: apmail-xmlgraphics-general-archive@www.apache.org Received: (qmail 41291 invoked from network); 6 Feb 2007 16:29:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Feb 2007 16:29:04 -0000 Received: (qmail 1658 invoked by uid 500); 6 Feb 2007 16:29:11 -0000 Mailing-List: contact general-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@xmlgraphics.apache.org Delivered-To: mailing list general@xmlgraphics.apache.org Received: (qmail 1647 invoked by uid 99); 6 Feb 2007 16:29:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Feb 2007 08:29:11 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [84.96.21.10] (HELO trinity.anyware-tech.com) (84.96.21.10) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Feb 2007 08:29:01 -0800 Received: from localhost (localhost [127.0.0.1]) by trinity.anyware-tech.com (Postfix) with ESMTP id 4983140AA23 for ; Tue, 6 Feb 2007 17:28:39 +0100 (CET) Received: from trinity.anyware-tech.com ([127.0.0.1]) by localhost (trinity.anyware-tech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 17054-04 for ; Tue, 6 Feb 2007 17:28:33 +0100 (CET) Received: from [10.0.2.15] (ender.anyware [10.0.2.15]) by trinity.anyware-tech.com (Postfix) with ESMTP id 67B2540A9F8 for ; Tue, 6 Feb 2007 17:28:33 +0100 (CET) Message-ID: <45C8ACB1.90407@anyware-tech.com> Date: Tue, 06 Feb 2007 17:28:33 +0100 From: Vincent Hennebert User-Agent: Thunderbird 1.5.0.9 (X11/20070103) MIME-Version: 1.0 To: general@xmlgraphics.apache.org Subject: Re: [VOTE] New component: DSC parser/processor References: <20070203190402.FC9C.DEV@jeremias-maerki.ch> In-Reply-To: <20070203190402.FC9C.DEV@jeremias-maerki.ch> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Debian amavisd-new at anyware-tech.com X-Virus-Checked: Checked by ClamAV on apache.org +1 This looks like a nice piece of code, well written and, even more importantly, well commented ;-) I've noticed a few glitches while skimming through the patch (prepend paths with org.apache.xmlgraphics.ps): - DSCConstants.java, l28: "inidicating" - PSGenerator.java, l88: "hardcoded to level 2" instead of 3 now - dsc.DefaultDSCHandler.java, l30: which "is simply passed"? "which simply passes"? I guess the latter is the correct one. Vincent Jeremias Maerki a �crit : > Hi there > > I've just finished the initial version of a DSC parser which I'd like to > put into XML Graphics Commons. What the heck is a DSC parser? :-) Here's > the text of the (somewhat minimal) documentation I wrote for the thing: > > ------------------------ > > 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. > > ------------------------ > > I hope that explains what I've built. I'd like to ask if anyone has any > reservations about my adding the DSC parser to XML Graphics Commons. > After all, it's a rather large and completely new thing and therefore I > thought it necessary to ask before committing. It's probably a lot less > interesting for Batik, but it is for FOP. Since it is designed to be > used separately from FOP I thought it was best to put it in Commons. > I've also already built the resource optimization functionality for FOP > that uses the DSC parser. I can commit those changes (Commons and FOP) > as soon as we know that nobody objects. > > I've made a patch containing the DSC parser available (including full > javadocs, an example and minimal documentation for the website), so you > can see what exactly we're talking about: > http://people.apache.org/~jeremias/xmlgraphics-commons-dsc-new.diff.txt > > > +1 from me for adding the DSC parser (obviously). > > Jeremias Maerki > > > --------------------------------------------------------------------- > Apache XML Graphics Project URL: http://xmlgraphics.apache.org/ > To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org > For additional commands, e-mail: general-help@xmlgraphics.apache.org > --------------------------------------------------------------------- Apache XML Graphics Project URL: http://xmlgraphics.apache.org/ To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: general-help@xmlgraphics.apache.org