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

Method set_opacity

src/__init__.py:1500–1510  ·  view source on GitHub ↗

Set opacity.

(self, opacity)

Source from the content-addressed store, hash-verified

1498 JM_add_oc_object(mupdf.pdf_get_bound_document(annot_obj), annot_obj, oc)
1499
1500 def set_opacity(self, opacity):
1501 """Set opacity."""
1502 CheckParent(self)
1503 annot = self.this
1504 if not _INRANGE(opacity, 0.0, 1.0):
1505 mupdf.pdf_set_annot_opacity(annot, 1)
1506 return
1507 mupdf.pdf_set_annot_opacity(annot, opacity)
1508 if opacity < 1.0:
1509 page = _pdf_annot_page(annot)
1510 page.transparency = 1
1511
1512 def set_open(self, is_open):
1513 """Set 'open' status of annotation or its Popup."""

Callers

nothing calls this directly

Calls 3

CheckParentFunction · 0.85
_INRANGEFunction · 0.85
_pdf_annot_pageFunction · 0.85

Tested by

no test coverage detected