I'm trying to implement an extension to add AcroForm (§ 8.6 page 671 of PDF
Reference 1.7) to a PDF document.
Below there are my thoughts about the process of building such extension,
could anyone tell me if there's somethig wrong?
I have to create a jar and configure an ElementMapping provider adding the
file /META-INF/services/org.apache.fop.fo.ElementMapping with the fully
qualified classname of my ElementMapping implementation class.
The ElementMapping implementation is responsible to provide a "Maker class"
that adds an objectified representation of the xsl tag to the FOTree.
After the creation of the FOTree the LayoutManagerMapping is initialized
inside the AreaTreeHandler. The LayoutManagerMapping holds the association
between each FONode and its LM.
For the first version of this extension I would prefer (to simplify things)
to have a LM that puts an AcroForm field on its own line.
How do I configure a LM for these objects?
It doesn't seem to exist an extension point for LM, obvious extension points
are represented by: ElementMapping, ContentHandlerFactory, Renderer,
FOEventHandler, PDFImageHandler, XMLHandler (for which I can configure an
implementation class provider in META-INF/services).
I saw the LayoutManagerMaker interface that has various methods for creating
a LM from a FONode or from another LM.
Do I need to add another method to this interface?
Then I needs two things to render an AcroForm in PDF:
* an array in the catalog dictionary (§ 3.6.1 page 141) that holds all
references to each field.
Do I need to patch the PDFRoot object to add such array for example
with a method "setAcroForm"?
* a field dictionary (page 674) for each field
Thanks and regards,
Alessandro