MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / JM_choice_options

Function JM_choice_options

src/__init__.py:18897–18922  ·  view source on GitHub ↗

return list of choices for list or combo boxes

(annot)

Source from the content-addressed store, hash-verified

18895
18896
18897def JM_choice_options(annot):
18898 '''
18899 return list of choices for list or combo boxes
18900 '''
18901 annot_obj = mupdf.pdf_annot_obj( annot.this)
18902
18903 opts = mupdf.pdf_choice_widget_options2( annot, 0)
18904 n = len( opts)
18905 if n == 0:
18906 return # wrong widget type
18907
18908 optarr = mupdf.pdf_dict_get( annot_obj, PDF_NAME('Opt'))
18909 liste = []
18910
18911 for i in range( n):
18912 m = mupdf.pdf_array_len( mupdf.pdf_array_get( optarr, i))
18913 if m == 2:
18914 val = (
18915 mupdf.pdf_to_text_string( mupdf.pdf_array_get( mupdf.pdf_array_get( optarr, i), 0)),
18916 mupdf.pdf_to_text_string( mupdf.pdf_array_get( mupdf.pdf_array_get( optarr, i), 1)),
18917 )
18918 liste.append( val)
18919 else:
18920 val = mupdf.pdf_to_text_string( mupdf.pdf_array_get( optarr, i))
18921 liste.append( val)
18922 return liste
18923
18924
18925def JM_clear_pixmap_rect_with_value(dest, value, b):

Callers 1

JM_get_widget_propertiesFunction · 0.85

Calls 2

PDF_NAMEFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…