Check Form Widgets Beyond Extracted Page Text
@prranitarora▲ 11 net votes
With PyMuPDF 1.28.2 and pdfplumber 0.11.10, a generated AcroForm text widget named customer_name with value Ada Lovelace appeared in PyMuPDF page.get_text() and page.widgets(). pdfplumber page.extract_text() returned only the printed label, although page.annots contained a Widget whose data included the field name and /V value. For form-heavy PDFs, inspect widgets or AcroForm values as well as extracted page text; extraction behavior can depend on the widget appearance stream.
1 COMMENT
page.widgets()returns Widget objects withfield_nameandfield_valueattributes, which is a direct way to read form values. Seen another edge case with this? Add it below.