ocrmypdf/OCRmyPDF · error · InputFileError

This PDF contains dynamic XFA forms created by Adobe LiveCyc

Error message

This PDF contains dynamic XFA forms created by Adobe LiveCycle Designer and can only be read by Adobe Acrobat or Adobe Reader.

What it means

Raised when the input PDF has the NeedsRendering flag, indicating it contains dynamic XFA forms. Dynamic XFA content cannot be rendered by standard PDF tools, only by Adobe Acrobat/Reader, so ocrmypdf cannot process it.

Source

Thrown at src/ocrmypdf/_pipeline.py:237

            progbar=progbar,
            max_workers=max_workers,
            use_threads=use_threads,
            check_pages=check_pages,
            executor=executor,
        )
    except pikepdf.PasswordError as e:
        raise EncryptedPdfError() from e
    except pikepdf.PdfError as e:
        raise InputFileError() from e


def validate_pdfinfo_options(context: PdfContext) -> None:
    """Validate the PDF info options."""
    pdfinfo = context.pdfinfo
    options = context.options

    if pdfinfo.needs_rendering:
        raise InputFileError(
            "This PDF contains dynamic XFA forms created by Adobe LiveCycle "
            "Designer and can only be read by Adobe Acrobat or Adobe Reader."
        )
    if pdfinfo.has_signature:
        if options.invalidate_digital_signatures:
            log.warning("All digital signatures will be invalidated")
        else:
            raise DigitalSignatureError()
    if pdfinfo.has_acroform:
        if options.mode == ProcessingMode.redo:
            raise InputFileError(
                "This PDF has a user fillable form. --redo-ocr (or --mode redo) "
                "is not currently possible on such files."
            )
        else:
            log.warning(
                "This PDF has a fillable form. "
                "Chances are it is a pure digital "

View on GitHub (pinned to 5074a0b0e1)

Solutions

  1. Re-export or flatten the form to a static PDF (e.g. print to PDF from Acrobat, or use pdftk/qpdf flattening tools)
  2. Remove the XFA layer with tools like qpdf or a PDF printer, then re-run ocrmypdf
Defensive patterns

Strategy: validation

Validate before calling

import pikepdf
with pikepdf.open(src) as pdf:
    if pdf.Root.get('/AcroForm', {}) and '/XFA' in (pdf.Root.AcroForm or {}):
        # check NeedsRendering
        if pdf.Root.get('/NeedsRendering', False):
            raise SystemExit('dynamic XFA not supported; flatten first')

Prevention

When it happens

Trigger: Input PDF whose pdfinfo reports needs_rendering=True; checked in validate_pdfinfo_options before the pipeline runs.

Common situations: Government/enterprise forms exported from Adobe LiveCycle Designer; hybrid PDFs with XFA layers.

Related errors


AI-assisted analysis of ocrmypdf/OCRmyPDF@5074a0b0e1 (2026-08-27). Data as JSON: /api/errors/8d2e2d701d1e6e87. Report an issue: GitHub.