Wonderful! Here we go: The most important thing to note here is that PDF output is still done by code in Apache FOP. That will remain so until I finally find/take the time to move the font and PDF libraries from FOP to XML Grapics Commons so we can move the PDF Transcoder over to Batik (long-term goal). So you will need to work on both codebases. FOP's PDF library is in the package org.apache.fop.pdf and the PDF transcoder is in org.apache.fop.svg.
The first thing is to get a copy of the PDF 1.5 specification so you can look up all the details on "Optional Content". The org.apache.fop.pdf.PDFDocument class has then to be extended so you can specify that you want to create a PDF 1.5 file. Please note that we have to be able to retain the PDF 1.4 functionality as PDF/A-1 requires PDF 1.4. So if PDFDocument is configured for PDF 1.4, the optional content feature may not be used. Then, some PDF classes will probably have to be written to generate the necessary PDF objects for "Optional Content". Finally, you need to dive into the Batik source code to find out exactly how to identify the various layers. I'm not exactly an expert in that area and some input from the Batik devs is probably necessary/welcome. I assume we'd have to provide a special PDFGElementBridge for the PDF transcoder so you can react on the layer changes. The bridge can be registered in the org.apache.fop.svg.PDFBridgeContext class. I hope that gets you started and that it doesn't scare you away. If you need anything else, please yell. I'll try to help as much as I can. On 08.04.2008 12:42:25 Honza Miksatko wrote: > > Jeremias, > > > Thanks for you answer - yes, I meant Optional Content in PDF 1.5. > > > Actually contributing to Batik and implementing this feature is also an > option to go. So guys, how can I help you implement this feature? ;) Could > you point me to classes that I should understand and where the implementation > would be? > > > Thanks, > Jan > > > > On 07.04.2008 22:02:43 Honza Miksatko wrote: > > > >> Hi all, > > > > > >> I need to convert SVG with layers (implemented as <g> groups) into PDF > >> with layers. Batik unfortunately produces a PDF _without_ layers. Is > >> this feature of PDF supported by the rasterizer? > > > > No. I'm not sure but I assume you mean the "Optional Content" feature > > introduced with PDF 1.5 (chapter 4.10), right? At the moment, we're > > creating PDF 1.4 only. In PDF 1.4, there's no notion of layers. > > > >> If not, do you know by chance a tool that supports it? > > > > Hmm, wrong question. The right question would be: How can I help you > > guys to implement this missing feature? ;-) > > > > > > > > > >> Thanks, > >> Jan > > > > > > > > Jeremias Maerki > > > Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
