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

Function get_textbox

src_classic/utils.py:575–588  ·  view source on GitHub ↗
(
    page: Page,
    rect: rect_like,
    textpage: TextPage = None,
)

Source from the content-addressed store, hash-verified

573
574
575def get_textbox(
576 page: Page,
577 rect: rect_like,
578 textpage: TextPage = None,
579) -> str:
580 tp = textpage
581 if tp is None:
582 tp = page.get_textpage()
583 elif getattr(tp, "parent") != page:
584 raise ValueError("not a textpage of this page")
585 rc = tp.extractTextbox(rect)
586 if textpage is None:
587 del tp
588 return rc
589
590
591def 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…