Skip to content
Discussion options

You must be logged in to vote

Ok, sorry. Please look at this example. We are looking at a combo and would like to see both values based on the selected (field) value:

In [1]: import fitz
In [2]: doc = fitz.open("widgettest-adobe.pdf")
In [3]: page = doc[0]
In [4]: w = page.load_widget(32)  # please ignore: we happen to know th xref in this case
In [5]: w.field_value  # a combo box, let's look at its selected value
Out[5]: 'England'
In [6]: [item for item in w.choice_values if w.field_value in item]  # see the complete item
Out[6]: [('England', 'GB')]
In [7]:

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@australgisinc
Comment options

@JorjMcKie
Comment options

Answer selected by australgisinc
@JorjMcKie
Comment options

@australgisinc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants