You could easily implement a FOP extension (for example as child of
fo:declarations) to transport the names of the files you want to embed
through the layout engine to the PDF renderer. Here's the list of things
to build:

- Implement a new subclass of FONode for the extension object and be
sure to override getExtensionAttachment(). An example is
org.apache.fop.render.ps.extensions.PSSetupCodeElement. The
ExtensionAttachment is what's transported through the layout engine.
- The extension object has to be registered with an ElementMapping class
(depending on which namespace you want to place the extension in).
- Extend the PDF library so it can produce an "EmbeddedFile" structure
and so the "EmbeddedFiles" name tree is added to the "Names" object (as
per the PDF spec).
- Extend the PDF renderer to accept and evaluate the ExtensionAttachment
so it generates the respective PDF objects. This would be done in
PDFRenderer.processOffDocumentItem().

Have fun.

On 13.06.2007 17:02:33 Andrejus Chaliapinas wrote:
> > There is a plan in the pipeline to support PDF as an image type in
> > fo:external-graphic. Only the first page in the PDF being referenced by
> > fo:external-graphic would be inserted in the generated document and that
> > page would need to be less than or equal to the size of the containing
> > page.
> > 
> > Is that roughly what you are looking for?
> > 
> > Chris
> > 
> 
> No. While I know that I could embed some graphics into resulting PDF,
> I'd like also to have ability of generating EmbeddedFiles element with
> all sub entries as it's described in Adobe spec. Then later such
> embedded files could be viewed via Attachments tab inside Adobe reader.
> So in that sense they are not an inline part of resulting document, but
> some sort of extension to it.
> 
> I'm not sure if I could achieve that while modifying some input
> stylesheet with my own defined elements, which will allow during FOP
> generation process open external file, put it content and form required
> PDF structures, i.e. EmbeddedFiles.
> 
> Andrejus



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to