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

Function get_textbox

src/utils.py:282–295  ·  view source on GitHub ↗
(
    page: pymupdf.Page,
    rect: rect_like,
    textpage: pymupdf.TextPage = None,
)

Source from the content-addressed store, hash-verified

280
281
282def get_textbox(
283 page: pymupdf.Page,
284 rect: rect_like,
285 textpage: pymupdf.TextPage = None,
286) -> str:
287 tp = textpage
288 if tp is None:
289 tp = page.get_textpage()
290 elif getattr(tp, "parent") != page:
291 raise ValueError("not a textpage of this page")
292 rc = tp.extractTextbox(rect)
293 if textpage is None:
294 del tp
295 return rc
296
297
298def get_text_selection(

Callers

nothing calls this directly

Calls 2

extractTextboxMethod · 0.80
get_textpageMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…