The PDF Forms Babylon - AcroForms and XFA

PDF forms are very popular among users. A tools programmer can, however, choose between two different forms systems: AcroForm and XFA. When to choose which and why?

The AcroForm system is available since version 1.2 and has been continuously enhanced since then. It describes the semantics of forms and its fields using PDF syntax. On the other hand, XFA (XML Forms Architecture) uses, as the name implies, the XML syntax for the same. AcroForms can be created using Adobe's Acrobat product and likewise XFA forms can be created using Adobe's LifeCycle Designer.

The XFA specification is referenced as an external document to ISO 32'000-1 (PDF 1.7) and has not yet been standardized by ISO. ISO 19'005-2 forbids most of the XFA data except for the form field content which was created by the form's user. XFA is not compatible with AcroForms but a static, filled out form can be transformed into a PDF/A document for archiving using a suitable software.

The advantages of using AcroForms are:
  • PDF syntax only
  • Easy to understand and implement
  • Standardized
  • Supported by most PDF processors
  • Suffices for simple forms applications
The advantages of using XFA are:
  • More flexible (dynamic forms based on field content)
  • Can be processed using XML manipulation libraries
  • Designed for sophisticated forms applications
Technically spoken, an XFA form is included as a resource in a shell PDF. The shell PDF is usually built as a minimal skeleton plus some fonts and images to render the form. The XFA form itself again may contain a PDF file.

XFA offers a number of benefits for forms designers and users. However, the main disadvantages of XFA forms are, that they are based on a complex, non-standardized technology and most PDF software therefore cannot process them.

Since this is a very controversial topic I'm eager to learn about your opinion. Please, don't hesitate to post a comment.



8 comments :

  1. I fully agree that the topic is highly controversial. And this comment will definitely show it… (Disclaimer: I have been creating highly complex and highly intelligent PDF forms since Acrobat JavaScript became publicly available with the Acrobat Forms plug-in 3.5 update (which got Acrobat to 3.02), more than 15 years ago.)

    One of the reason for the controversial opinions is definitely the era when Adobe had "XFA über Alles", led by the mindset of the more or less freshly acquired Accelio. They never really communicated the strengths of the two technologies, but threw the design tool (nowadays known as "LiveCycle Designer" at anyone buying Acrobat Pro for Windows.

    Now, to the above list, I would like to add a few things:

    PDF forms (using AcroForms technology):

    • Support on mobile devices (the level of support of active elements depends on the actual PDF viewer)

    • Allows any level of complexity of forms; in particular any level of calculations; (Acrobat) JavaScript is a full-grown programming language, and reasonably well documented

    • Powerful and well controllable Field event sequence

    • Future-proof because it is part of the ISO standard

    • Dynamic forms are possible (they may require some programming, and maybe some creativity, but there are fully dynamic, multilingual PDF forms in productive use)

    • Processing of exported data possible with XML tools (if export/import occurs using XFDF)

    • Almost all of the functionality (for forms) is now available for Adobe Reader

    • Good quality output


    XFA forms:

    • relatively easy to connect to databases

    • good ties to SAP


    However, there are more serious points against XFA forms:

    • Support for mobile devices only via server support (a server from the LiveCycle product family, which is an enterprise product at enterprise prices).

    • Quality of presentation (limited, if any, support of line art for logos etc.)

    • Big file sizes (if a single page form is below 1 MB, it is already great)


    I may be biased, but so far, I have not been able to see any benefit of XFA for me as form developer nor as user.

    One can say that XFA technology is more suitable for cases where the data only matters, and presentation is really secondary, whereas PDF/Acroforms is more suitable when presentation matters (meaning that the form is also important as a document).

    ReplyDelete
    Replies
    1. I very much appreciate the view of a seasoned expert like you. It is certainly of great value for someone who is new to the topic. And, I personally like your conclusion. Thank you for the comment, Max.

      Delete
    2. You're most welcome, and thanks for the flowers.

      Delete
  2. I wrote some AcroForms processors but haven't had the opportunity to do the same for XFA. Is there anyone out there who has written software to process XFA forms? I would be interested in her or his experiences.

    ReplyDelete
  3. I am having good success using iText XFA Worker and Adobe LiveCycle Designer but we have had to do a fair amount of XSLT and XPath programming.

    ReplyDelete
  4. We have a project with more than 30 XFA forms that is on the way to either being redone in Acroform or Word Form. As a public use form XFA is troublesome. There was notice about 2 years ago that XFA was not going to be adopted, not that they were waiting for adoption. This means future development and support are unlikely.

    ReplyDelete
    Replies
    1. Thank you for sharing your thoughts, Carlos

      Delete