ListBox retrieve value
( annot)
| 20452 | return mupdf.fz_make_irect(f[0], f[1], f[2], f[3]) |
| 20453 | |
| 20454 | def JM_listbox_value( annot): |
| 20455 | ''' |
| 20456 | ListBox retrieve value |
| 20457 | ''' |
| 20458 | # may be single value or array |
| 20459 | annot_obj = mupdf.pdf_annot_obj( annot) |
| 20460 | optarr = mupdf.pdf_dict_get( annot_obj, PDF_NAME('V')) |
| 20461 | if mupdf.pdf_is_string( optarr): # a single string |
| 20462 | return mupdf.pdf_to_text_string( optarr) |
| 20463 | |
| 20464 | # value is an array (may have len 0) |
| 20465 | n = mupdf.pdf_array_len( optarr) |
| 20466 | liste = [] |
| 20467 | |
| 20468 | # extract a list of strings |
| 20469 | # each entry may again be an array: take second entry then |
| 20470 | for i in range( n): |
| 20471 | elem = mupdf.pdf_array_get( optarr, i) |
| 20472 | if mupdf.pdf_is_array( elem): |
| 20473 | elem = mupdf.pdf_array_get( elem, 1) |
| 20474 | liste.append( JM_UnicodeFromStr( mupdf.pdf_to_text_string( elem))) |
| 20475 | return liste |
| 20476 | |
| 20477 | |
| 20478 | def JM_make_annot_DA(annot, ncol, col, fontname, fontsize): |
nothing calls this directly
no test coverage detected
searching dependent graphs…