Can Foxit Quick PDF Library print PDF forms that use XFA form fields?
There are two types of PDF forms – XFA and AcroForms.
An XFA form will always have a corresponding AcroForm.
When getting/setting XFA form fields – Foxit Quick PDF library only changes the XML description of the fields in the PDF.
When setting the AcroForm fields, and appearance stream can be generated for the form fields which will allow them to be rendered or printed.
So Foxit Quick PDF Library can be used to set XFA form fields and if the PDF is opened in Acrobat the new values will be shown.
But to print an XFA form field the only solution is to find the corresponding AcroForm fields and set the value there too.
Here’s some code to help you determine the types of form fields used in the PDF.
if (FormFieldCount() <> 0) and (GetXFAFormFieldCount() <> 0) then
// PDF contains both AcroForm and XFA form fields
else if FormFieldCount() <> 0 then
// PDF contains AcroForm form fields
else if GetXFAFormFieldCount() <> 0 then
// PDF contains XFA form fields
If both FormFieldCount and GetXFAFormFieldCount return values greater than zero then the PDF contains both XFA and AcroForm form fields and you should update both sets of form fields accordingly in order to ensure that the printing of the PDF form is successful.
This article refers to a deprecated product. If you are looking for support for Foxit PDF SDK, please click here.
Updated on May 16, 2022