Open
Description
Description of the bug
I am using the 940b: https://www.irs.gov/pub/irs-pdf/f940b.pdf
The PDF file has identical pages, and each page has this specific dropdown:
The choice_values variable is empty.
import pymupdf
pdf = pymupdf.open('f940b.pdf')
for page in pdf:
for widget in page.widgets():
if widget.field_type_string == 'ComboBox':
print(widget.choice_values)
widget.update()
pdf.save('f940b-output.pdf')
Expected output:
[' - Select One - ', ' ', 'Cincinnati, OH 45999', 'Memphis, TN 37501', 'Ogden, UT 84201', 'Philadelphia, PA 19255']
[' - Select One - ', ' ', 'Cincinnati, OH 45999', 'Memphis, TN 37501', 'Ogden, UT 84201', 'Philadelphia, PA 19255']
Actual output:
['', '', '', '', '', '']
[' - Select One - ', ' ', 'Cincinnati, OH 45999', 'Memphis, TN 37501', 'Ogden, UT 84201', 'Philadelphia, PA 19255']
This also affects the resulting f940b-output.pdf
, where the first combo box is suddenly completely empty with no choices available.
How to reproduce the bug
See above
PyMuPDF version
1.24.13
Operating system
Linux
Python version
3.12