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

Method get_label

src/__init__.py:11774–11788  ·  view source on GitHub ↗

Return the label for this PDF page. Args: page: page object. Returns: The label (str) of the page. Errors return an empty string.

(page)

Source from the content-addressed store, hash-verified

11772 return bboxes
11773
11774 def get_label(page):
11775 """Return the label for this PDF page.
11776
11777 Args:
11778 page: page object.
11779 Returns:
11780 The label (str) of the page. Errors return an empty string.
11781 """
11782 # Jorj McKie, 2021-01-06
11783
11784 labels = page.parent._get_page_labels()
11785 if not labels:
11786 return ""
11787 labels.sort()
11788 return utils.get_label_pno(page.number, labels)
11789
11790 def get_links(page: 'Page') -> list:
11791 """Create a list of all links contained in a PDF page.

Callers 2

test_setlabelsFunction · 0.80
test_labels_styleAFunction · 0.80

Calls 1

_get_page_labelsMethod · 0.80

Tested by 2

test_setlabelsFunction · 0.64
test_labels_styleAFunction · 0.64