Search code examples
adobelivecyclelivecycle-designerxfa

How to create interactive form with fixed pages using Adobe LiveCycle API?


When I try to open a regular PDF (which doesn't contain an XFA form) using Adobe LiveCycle ES4 Designer it prompts a window (New Form Assistant) and asks me to select how I want to work with the PDF. The options are:

  • Create an Interactive Form with Fixed Pages
  • Create an Interactive Form with a Flowable Layout

I choose the first one and continue. Then, without doing anything I save the file (using save as). Save as type is 'Acrobat (Static) PDF Form (.pdf)*', and as a matter of fact that's the only option for this scenario. After I save the file, I figured out that, although both files are visually same in the PDF reader, the saved and the original files are different, such that, saved file contains XFA form. In my case XFA form is as follows:

<topmostSubform xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:dataNode="dataGroup"/>

I have two questions about this.

  1. Can I open a regular PDF and add an XFA form to it without corrupting the original PDF content, using the API?
  2. If the first one is possible, can I add invisible fields to that PDF, again using the API?

In short, what I want to do is adding a filled XFA form to a regular PDF and I'm asking if it is possible, using the API?


Solution

  • There is no API in Adobe LiveCycle that lets you insert an XFAF (XFA Foreground) form into a PDF.

    It should be doable using various PDF libraries however. You need to create the form you want to add and then insert it into the PDF using a PDF library like iText, PDFBox or Big Faceless. Inserting is a little tricky however as the XDP is broken into sections in the PDF. I would generate a XFAF PDF using LiveCycle Designer and then examine it using the same PDF library that you intend to reproduce the process with.

    The presence attribute isn't specifically excluded from the XFAF profile, so invisible fields should work, however I would test it with LiveCycle Designer first. If you add invisible fields into a Fixed Page PDF and it works (i.e. you test the resulting PDF - I have no doubt that it will let you add them but it's possible that it doesn't make them invisible) then you should be able to emulate that using a programatically constructed XFAF PDF.

    Just a word of caution. This is not something that I think many people outside of the LiveCycle Designer team have tried. If you head down this route you will be blazing the trail.