ocrmypdf/OCRmyPDF · error · InputFileError
This PDF has a user fillable form. --redo-ocr (or --mode red
Error message
This PDF has a user fillable form. --redo-ocr (or --mode redo) is not currently possible on such files.
What it means
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.
Source
Thrown at src/ocrmypdf/_pipeline.py:248
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 "
"document that does not need OCR."
)
if options.mode != ProcessingMode.force:
log.info(
"Use the option --force-ocr (or --mode force) to produce an "
"image of the form and all filled form fields. The output PDF "
"will be 'flattened' and will no longer be fillable."
)
if pdfinfo.is_tagged or pdfinfo.has_structure_tree:
log.warning(
"This PDF contains structural markup (it is a Tagged PDF or "View on GitHub (pinned to 5074a0b0e1)
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
Example fix
# before ocrmypdf --redo-ocr form.pdf out.pdf # after qpdf --flatten-annotations=all --generate-appearances form.pdf flat.pdf ocrmypdf --redo-ocr flat.pdf out.pdf
Defensive patterns
Strategy: validation
Validate before calling
import pikepdf
with pikepdf.open(src) as pdf:
has_acroform = '/AcroForm' in pdf.Root
if has_acroform and opts.mode == 'redo':
opts.mode = 'skip' # or flatten form first Prevention
- Detect AcroForm fields and flatten or downgrade mode before processing
When it happens
Trigger: pdfinfo reports has_acroform=True and options.mode == ProcessingMode.redo; checked in validate_pdfinfo_options.
Common situations: Trying to re-OCR fillable government or business forms with --redo-ocr.
Related errors
- --redo-ocr (or --mode redo) is not currently compatible with
- --mode strip removes the OCR text layer without rasterizing
- Since you specified `--output-type none`, the output file {s
- Input file is an image, but the resolution (DPI) is not cred
- Input file is an image, but has no resolution (DPI) in its m
AI-assisted analysis of ocrmypdf/OCRmyPDF@5074a0b0e1 (2026-08-27).
Data as JSON: /api/errors/2f6e5038f8e700e6.
Report an issue: GitHub.