How to fix "XFA forms are not supported by this reader"

XFA forms are an Adobe-proprietary format only supported by Acrobat and Reader. Most viewers show a blank page or this error.
Feature Not Supported
XFA forms are not supported by this reader

Why this happens

The viewer does not implement the XFA renderer

XFA is an Adobe proprietary standard that requires a dedicated rendering engine. Browsers (Chrome, Firefox, Safari), macOS Preview, Linux PDF viewers (Evince, Okular), and most non-Adobe mobile apps do not implement XFA. They display the fallback content defined in the PDF — often a blank page or a message asking the user to open in Acrobat.

Adobe's XFA renderer has been deprecated

Adobe deprecated XFA in PDF 2.0 (ISO 32000-2) and has been discouraging its use since 2017. Even in Adobe Reader, XFA support may be disabled in newer versions or restricted in certain deployment modes (e.g. Reader in browser mode).

The XFA form has no static AcroForm fallback

XFA PDFs can optionally include a pre-rendered AcroForm representation for viewers that don't support XFA. If the creator didn't include a fallback, non-XFA viewers render a blank page. This is the most common reason the form appears completely empty.

How to fix it

  1. Flatten the XFA form to a static PDF

    If you don't need the fields to remain interactive — for example, you're archiving a completed form — flatten the XFA into a static PDF. This removes all form logic and produces a plain document any viewer can display.

    code
    use pdfluent::PdfDocument;
    
    let mut doc = PdfDocument::open("completed-xfa-form.pdf")?;
    
    // Flatten XFA into a non-interactive static PDF
    doc.flatten_xfa()?;
    doc.save("flattened-output.pdf")?;
  2. Extract the XFA data and process it yourself

    When the form logic matters more than the rendering, read the field model out of the document and work with the values. PDFluent gives you the fields and their values; producing a new document from them is a job for whatever generates your other documents, because PDFluent has no authoring API.

    code
    use pdfluent::PdfDocument;
    
    let mut doc = PdfDocument::open("xfa-form.pdf")?;
    
    let model = doc.xfa_form_model()?;
    println!("{} fields over {} layout pages", model.fields.len(), model.page_count);
    
    for field in &model.fields {
        println!("{} = {:?} ({:?})", field.name, field.value, field.field_type);
    }

Frequently asked questions

Which PDF viewers support XFA?
Adobe Acrobat Pro and Adobe Acrobat Reader (desktop versions) are the primary XFA-capable viewers. Some enterprise document management systems (e.g. IBM FileNet, OpenText) have licensed the XFA renderer. No browser-based viewer, macOS Preview, or open-source viewer supports XFA.
How do I convert XFA to AcroForm?
Not with PDFluent. There is no XFA-to-AcroForm conversion in the SDK: it reads the XFA field model, writes values back with set_xfa_field_value, and flattens with flatten_xfa. Flattening is the route that makes an XFA document open correctly everywhere -- it produces a static PDF with no form logic, which is what most archiving and viewing cases actually need.
Is XFA deprecated?
Yes. XFA was explicitly excluded from the PDF 2.0 specification (ISO 32000-2:2017). Adobe officially deprecated XFA in Acrobat DC and recommends migrating to AcroForms or Adobe Experience Manager. New PDF tooling should not generate XFA and should convert existing XFA documents when encountered.