-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Has MCVEA minimal, complete and verifiable example helps a lot to debug / understand feature requestsA minimal, complete and verifiable example helps a lot to debug / understand feature requestsPdfReaderThe PdfReader component is affectedThe PdfReader component is affectedis-bugFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFworkflow-formsFrom a users perspective, forms is the affected feature/workflowFrom a users perspective, forms is the affected feature/workflow
Description
I have a pdf form with multiple Form-Fields in it. The function "getFormTextFields()" is only returning a dictionary without the dropdown-fields. The dictionary contains the information of all other fields, but the dropdown-fields are simply missing.
Minimal Example
from PyPDF2 import PdfReader
reader = PdfReader("sample-files/012-libreoffice-form/libreoffice-form.pdf")
reader.get_form_text_fields()gives
{"First Name": "Alice", "Last Name": "", "Birthday": "", "First Name_2": "Bob"}The "Nationality" part is missing.
On the other hand:
>>> reader.get_fields()
{'First Name': {'/FT': '/Tx', '/T': 'First Name', '/V': 'Alice', '/DV': 'Alice'},
'Last Name': {'/FT': '/Tx', '/T': 'Last Name', '/V': '', '/DV': ''},
'female': {'/FT': '/Btn', '/Kids': [IndirectObject(7, 0), IndirectObject(9, 0)], '/T': 'female', '/Ff': 49152, '/V': '/Off', '/DV': '/Off'},
'Birthday': {'/FT': '/Tx', '/T': 'Birthday', '/V': '', '/DV': ''},
'gdpr': {'/FT': '/Btn', '/T': 'gdpr', '/V': '/Off', '/DV': '/Off'},
'other': {'/FT': '/Btn', '/T': 'other', '/V': '/Off', '/DV': '/Off'},
'First Name_2': {'/FT': '/Tx', '/T': 'First Name_2', '/Ff': 4096, '/V': 'Bob', '/DV': 'Bob'},
'Nationality': {'/FT': '/Ch', '/T': 'Nationality', '/Ff': 131072, '/V': '', '/DV': ''}}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Has MCVEA minimal, complete and verifiable example helps a lot to debug / understand feature requestsA minimal, complete and verifiable example helps a lot to debug / understand feature requestsPdfReaderThe PdfReader component is affectedThe PdfReader component is affectedis-bugFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFworkflow-formsFrom a users perspective, forms is the affected feature/workflowFrom a users perspective, forms is the affected feature/workflow