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

Method get_page_labels

src/__init__.py:5079–5087  ·  view source on GitHub ↗

Return page label definitions in PDF document. Returns: A list of dictionaries with the following format: {'startpage': int, 'prefix': str, 'style': str, 'firstpagenum': int}.

(self)

Source from the content-addressed store, hash-verified

5077 return val
5078
5079 def get_page_labels(self):
5080 """Return page label definitions in PDF document.
5081
5082 Returns:
5083 A list of dictionaries with the following format:
5084 {'startpage': int, 'prefix': str, 'style': str, 'firstpagenum': int}.
5085 """
5086 # Jorj McKie, 2021-01-10
5087 return [utils.rule_dict(item) for item in self._get_page_labels()]
5088
5089 def get_page_numbers(doc, label, only_one=False):
5090 """Return a list of page numbers with the given label.

Callers 2

test_setlabelsFunction · 0.80
test_labels_styleAFunction · 0.80

Calls 1

_get_page_labelsMethod · 0.95

Tested by 2

test_setlabelsFunction · 0.64
test_labels_styleAFunction · 0.64