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

Method extractText

src/__init__.py:16596–16602  ·  view source on GitHub ↗

Return simple, bare text on the page.

(self, sort=False)

Source from the content-addressed store, hash-verified

16594 return found
16595
16596 def extractText(self, sort=False) -> str:
16597 """Return simple, bare text on the page."""
16598 if not sort:
16599 return self._extractText(0)
16600 blocks = self.extractBLOCKS()[:]
16601 blocks.sort(key=lambda b: (b[3], b[0]))
16602 return "".join([b[4] for b in blocks])
16603
16604 def extractTextbox(self, rect):
16605 this_tpage = self.this

Callers 4

test_extendable_textpageFunction · 0.95
get_textFunction · 0.80
get_textFunction · 0.80
test_2270Function · 0.80

Calls 2

_extractTextMethod · 0.95
extractBLOCKSMethod · 0.95

Tested by 2

test_extendable_textpageFunction · 0.76
test_2270Function · 0.64