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

Function JM_annot_border

src/__init__.py:18598–18635  ·  view source on GitHub ↗
(annot_obj)

Source from the content-addressed store, hash-verified

18596
18597
18598def JM_annot_border(annot_obj):
18599 dash_py = list()
18600 style = None
18601 width = -1
18602 clouds = -1
18603 obj = None
18604
18605 obj = mupdf.pdf_dict_get( annot_obj, PDF_NAME('Border'))
18606 if mupdf.pdf_is_array( obj):
18607 width = mupdf.pdf_to_real( mupdf.pdf_array_get( obj, 2))
18608 if mupdf.pdf_array_len( obj) == 4:
18609 dash = mupdf.pdf_array_get( obj, 3)
18610 for i in range( mupdf.pdf_array_len( dash)):
18611 val = mupdf.pdf_to_int( mupdf.pdf_array_get( dash, i))
18612 dash_py.append( val)
18613
18614 bs_o = mupdf.pdf_dict_get( annot_obj, PDF_NAME('BS'))
18615 if bs_o.m_internal:
18616 width = mupdf.pdf_to_real( mupdf.pdf_dict_get( bs_o, PDF_NAME('W')))
18617 style = mupdf.pdf_to_name( mupdf.pdf_dict_get( bs_o, PDF_NAME('S')))
18618 if style == '':
18619 style = None
18620 obj = mupdf.pdf_dict_get( bs_o, PDF_NAME('D'))
18621 if obj.m_internal:
18622 for i in range( mupdf.pdf_array_len( obj)):
18623 val = mupdf.pdf_to_int( mupdf.pdf_array_get( obj, i))
18624 dash_py.append( val)
18625
18626 obj = mupdf.pdf_dict_get( annot_obj, PDF_NAME('BE'))
18627 if obj.m_internal:
18628 clouds = mupdf.pdf_to_int( mupdf.pdf_dict_get( obj, PDF_NAME('I')))
18629
18630 res = dict()
18631 res[ dictkey_width] = width
18632 res[ dictkey_dashes] = tuple( dash_py)
18633 res[ dictkey_style] = style
18634 res[ 'clouds'] = clouds
18635 return res
18636
18637
18638def JM_annot_colors(annot_obj):

Callers 3

borderMethod · 0.85
_borderMethod · 0.85
JM_annot_set_borderFunction · 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…