ImageGear has limited support for PDF documents containing XFA forms.
Enabling XFA
By default, loading a PDF document that contains XFA data will throw an exception and the document will not be loaded since special consideration is needed on how to treat such a document.
In order to enable opening of PDF documents containing XFA data, you have to set the value of the 'XFAAllowed' PDF filter control parameter to true. See ImGearFormatParameters.GetByName() method and ImGearControlParameter.Value property.
Rendering XFA
PDF documents containing XFA come in different flavors: dynamic and static. Currently, ImageGear does not support rendering of dynamic XFA content. Usually, a placeholder page with a warning message that is present in the document will be rendered instead. Documents containing static XFA will usually render correctly since the XFA information is duplicated in the PDF as AcroForm fields and/or content, and XFA data is simply ignored.
Modifying Forms
Since XFA data is currently largely ignored by ImageGear, changing form fields by means of the ImGearPDFDocument.Form and related objects will not update the XFA data, and these will become out of sync with the AcroForms data. Fields and their widgets should therefore not be added, removed, modified, flattened or filled in.
The only valid operation on a form when XFA is present is the flattening of the whole form using ImGearPDFDocument.FlattenFormFields(). This will flatten any AcroForm fields and remove the Form, including any XFA data.
Detecting and Removing XFA
ImageGear allows you to determine whether a document has XFA and also whether it is dynamic or static, using the property ImGearPDFDocument.XFAContentType.
Complete removal of the XFA data can be done using the method ImGearPDFDocument.RemoveXFA(). This will not change any AcroForm data.
See the OpenPDFWithXFA sample for an example of how to open PDF file with XFA, detect a type of XFA and remove XML forms from the document.