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

Method get_page_fonts

src/__init__.py:5049–5065  ·  view source on GitHub ↗

Retrieve a list of fonts used on a page.

(self, pno: int, full: bool =False)

Source from the content-addressed store, hash-verified

5047 return xrefs
5048
5049 def get_page_fonts(self, pno: int, full: bool =False) -> list:
5050 """Retrieve a list of fonts used on a page.
5051 """
5052 if self.is_closed or self.is_encrypted:
5053 raise ValueError("document closed or encrypted")
5054 if not self.is_pdf:
5055 return ()
5056 if type(pno) is not int:
5057 try:
5058 pno = pno.number
5059 except Exception:
5060 exception_info()
5061 raise ValueError("need a Page or page number")
5062 val = self._getPageInfo(pno, 1)
5063 if not full:
5064 return [v[:-1] for v in val]
5065 return val
5066
5067 def get_page_images(self, pno: int, full: bool =False) -> list:
5068 """Retrieve a list of images used on a page.

Callers 10

extract_objectsFunction · 0.80
repl_fontnamesMethod · 0.80
get_fontsMethod · 0.80
insert_imageMethod · 0.80
show_pdf_pageMethod · 0.80
extract_objectsFunction · 0.80
show_pdf_pageFunction · 0.80
insert_imageFunction · 0.80
repl_fontnamesFunction · 0.80
test_survive_namesFunction · 0.80

Calls 2

_getPageInfoMethod · 0.95
exception_infoFunction · 0.85

Tested by 1

test_survive_namesFunction · 0.64