{"record":{"id":"8d2e2d701d1e6e87","repo":"ocrmypdf/OCRmyPDF","slug":"this-pdf-contains-dynamic-xfa-forms-created-by-ado","errorCode":null,"errorMessage":"This PDF contains dynamic XFA forms created by Adobe LiveCycle Designer and can only be read by Adobe Acrobat or Adobe Reader.","messagePattern":"This PDF contains dynamic XFA forms created by Adobe LiveCycle Designer and can only be read by Adobe Acrobat or Adobe Reader\\.","errorType":"error_code","errorClass":"InputFileError","httpStatus":null,"severity":"error","filePath":"src/ocrmypdf/_pipeline.py","lineNumber":237,"sourceCode":"            progbar=progbar,\n            max_workers=max_workers,\n            use_threads=use_threads,\n            check_pages=check_pages,\n            executor=executor,\n        )\n    except pikepdf.PasswordError as e:\n        raise EncryptedPdfError() from e\n    except pikepdf.PdfError as e:\n        raise InputFileError() from e\n\n\ndef validate_pdfinfo_options(context: PdfContext) -> None:\n    \"\"\"Validate the PDF info options.\"\"\"\n    pdfinfo = context.pdfinfo\n    options = context.options\n\n    if pdfinfo.needs_rendering:\n        raise InputFileError(\n            \"This PDF contains dynamic XFA forms created by Adobe LiveCycle \"\n            \"Designer and can only be read by Adobe Acrobat or Adobe Reader.\"\n        )\n    if pdfinfo.has_signature:\n        if options.invalidate_digital_signatures:\n            log.warning(\"All digital signatures will be invalidated\")\n        else:\n            raise DigitalSignatureError()\n    if pdfinfo.has_acroform:\n        if options.mode == ProcessingMode.redo:\n            raise InputFileError(\n                \"This PDF has a user fillable form. --redo-ocr (or --mode redo) \"\n                \"is not currently possible on such files.\"\n            )\n        else:\n            log.warning(\n                \"This PDF has a fillable form. \"\n                \"Chances are it is a pure digital \"","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/ocrmypdf/OCRmyPDF/blob/5074a0b0e109362422b768fd271ed84bf717c4ec/src/ocrmypdf/_pipeline.py#L219-L255","documentation":"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.","triggerScenarios":"Input PDF whose pdfinfo reports needs_rendering=True; checked in validate_pdfinfo_options before the pipeline runs.","commonSituations":"Government/enterprise forms exported from Adobe LiveCycle Designer; hybrid PDFs with XFA layers.","solutions":["Re-export or flatten the form to a static PDF (e.g. print to PDF from Acrobat, or use pdftk/qpdf flattening tools)","Remove the XFA layer with tools like qpdf or a PDF printer, then re-run ocrmypdf"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import pikepdf\nwith pikepdf.open(src) as pdf:\n    if pdf.Root.get('/AcroForm', {}) and '/XFA' in (pdf.Root.AcroForm or {}):\n        # check NeedsRendering\n        if pdf.Root.get('/NeedsRendering', False):\n            raise SystemExit('dynamic XFA not supported; flatten first')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Flatten forms with Acrobat/qpdf before batching through ocrmypdf"],"tags":["ocr","ocrmypdf","pdf","xfa","forms"],"backgroundTag":"unsupported-pdf-feature","analyzedSha":"5074a0b0e109362422b768fd271ed84bf717c4ec","analyzedAt":"2026-08-27T11:57:38.523Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}