{"record":{"id":"2f6e5038f8e700e6","repo":"ocrmypdf/OCRmyPDF","slug":"this-pdf-has-a-user-fillable-form-redo-ocr-or","errorCode":null,"errorMessage":"This PDF has a user fillable form. --redo-ocr (or --mode redo) is not currently possible on such files.","messagePattern":"This PDF has a user fillable form\\. --redo-ocr \\(or --mode redo\\) is not currently possible on such files\\.","errorType":"error_code","errorClass":"InputFileError","httpStatus":null,"severity":"error","filePath":"src/ocrmypdf/_pipeline.py","lineNumber":248,"sourceCode":"\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 \"\n                \"document that does not need OCR.\"\n            )\n            if options.mode != ProcessingMode.force:\n                log.info(\n                    \"Use the option --force-ocr (or --mode force) to produce an \"\n                    \"image of the form and all filled form fields. The output PDF \"\n                    \"will be 'flattened' and will no longer be fillable.\"\n                )\n    if pdfinfo.is_tagged or pdfinfo.has_structure_tree:\n        log.warning(\n            \"This PDF contains structural markup (it is a Tagged PDF or \"","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/ocrmypdf/OCRmyPDF/blob/5074a0b0e109362422b768fd271ed84bf717c4ec/src/ocrmypdf/_pipeline.py#L230-L266","documentation":"Raised when the input PDF has an AcroForm (user-fillable form) and --redo-ocr/--mode redo is requested. Redo mode works by distinguishing text from content, and form field overlays break that assumption.","triggerScenarios":"pdfinfo reports has_acroform=True and options.mode == ProcessingMode.redo; checked in validate_pdfinfo_options.","commonSituations":"Trying to re-OCR fillable government or business forms with --redo-ocr.","solutions":["Use default mode or --skip-text instead of --mode redo","Flatten the form fields first (pdftk in.pdf dump_data... or qpdf --flatten-annotations=all) then run redo mode"],"exampleFix":"# before\nocrmypdf --redo-ocr form.pdf out.pdf\n# after\nqpdf --flatten-annotations=all --generate-appearances form.pdf flat.pdf\nocrmypdf --redo-ocr flat.pdf out.pdf","handlingStrategy":"validation","validationCode":"import pikepdf\nwith pikepdf.open(src) as pdf:\n    has_acroform = '/AcroForm' in pdf.Root\n    if has_acroform and opts.mode == 'redo':\n        opts.mode = 'skip'  # or flatten form first","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Detect AcroForm fields and flatten or downgrade mode before processing"],"tags":["ocr","ocrmypdf","pdf-forms","acroform","option-compatibility"],"backgroundTag":"incompatible-cli-options","analyzedSha":"5074a0b0e109362422b768fd271ed84bf717c4ec","analyzedAt":"2026-08-27T11:57:38.523Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}