(
page: pymupdf.Page,
rect: rect_like,
textpage: pymupdf.TextPage = None,
)
| 280 | |
| 281 | |
| 282 | def 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 | |
| 298 | def get_text_selection( |
nothing calls this directly
no test coverage detected
searching dependent graphs…