from pprint import pprint
from popplerqt5 import Poppler as poppler
P = poppler.Document.load('formfieldchoice.pdf')
fields = P[0].formFields()
for f in fields:
print(f.name())
pprint(f.choicesWithExportValues())
Listfield 1
[('l1', 'l1'), ('l2', 'l2'), ('l3', 'l3')]
Combobox 1
[('Combo Item 1', 'Combo Item 1'),
('Combo Item 2', 'Combo Item 2'),
('Combo Item a third one', 'Combo Item a third one')]
Empty List Field
[]
(I have no easy access to Acrobat Professional or do not know how to create a PDF Form with a different export value than the field text value)
Fixes #43
formfieldchoice.pdf made with LibreOffice.
(I have no easy access to Acrobat Professional or do not know how to create a PDF Form with a different export value than the field text value)