Is is possible to create invisible XFA Form?

112 Views Asked by At

I want to craete a PDF with XFA data but I don't want the XFA data to be visible when the PDF is viewed, however, I want it to be reachable via following code:

ByteArrayOutputStream baos = new ByteArrayOutputStream();       
PdfReader reader = new PdfReader(src);
PdfStamper stamper = new PdfStamper(reader, baos);
AcroFields form = stamper.getAcroFields();
XfaForm xfa = form.getXfa();

How can I do this?

Thanks

1

There are 1 best solutions below

0
On BEST ANSWER

Apparently what I asked is possible according to XML Forms Architecture (XFA) Specification Version 3.3. It can be done using XFAF. Under 'The Relationship between XFA and PDF' section in page 20 it says:

There is overlapping functionality between XFA and PDF. However the two grammars serve different purposes. XFA has a more abstract view of a form than PDF. XFA concentrates on the logic of a form whereas PDF concentrates on the appearance. However it is possible to combine the two. When the two are combined the result is a form in which each page of the XFA form overlays a PDF background. This architecture is sometimes referred to as XFAF (XFA Foreground).