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

Method layer_ui_configs

src/__init__.py:5704–5727  ·  view source on GitHub ↗

Show OC visibility status modifiable by user.

(self)

Source from the content-addressed store, hash-verified

5702 return last_loc.chapter, last_loc.page
5703
5704 def layer_ui_configs(self):
5705 """Show OC visibility status modifiable by user."""
5706 pdf = _as_pdf_document(self)
5707 info = mupdf.PdfLayerConfigUi()
5708 n = mupdf.pdf_count_layer_config_ui( pdf)
5709 rc = []
5710 for i in range(n):
5711 mupdf.pdf_layer_config_ui_info( pdf, i, info)
5712 if info.type == 1:
5713 type_ = "checkbox"
5714 elif info.type == 2:
5715 type_ = "radiobox"
5716 else:
5717 type_ = "label"
5718 item = {
5719 "number": i,
5720 "text": info.text,
5721 "depth": info.depth,
5722 "type": type_,
5723 "on": info.selected,
5724 "locked": info.locked,
5725 }
5726 rc.append(item)
5727 return rc
5728
5729 def layout(self, rect=None, width=0, height=0, fontsize=11):
5730 """Re-layout a reflowable document."""

Callers 4

set_layer_ui_configMethod · 0.95
test_oc1Function · 0.80
test_3143Function · 0.80
test_4479Function · 0.80

Calls 2

_as_pdf_documentFunction · 0.85
appendMethod · 0.45

Tested by 3

test_oc1Function · 0.64
test_3143Function · 0.64
test_4479Function · 0.64