(page: Any)
| 299 | |
| 300 | |
| 301 | def _ocr_page_with_pymupdf_ocr(page: Any) -> str: |
| 302 | textpage_ocr = getattr(page, "get_textpage_ocr", None) |
| 303 | if not callable(textpage_ocr): |
| 304 | return "" |
| 305 | |
| 306 | try: |
| 307 | textpage = textpage_ocr(dpi=PDF_PARSER_OCR_DPI, language=PDF_PARSER_OCR_LANG) |
| 308 | return str(page.get_text("text", textpage=textpage) or "").strip() |
| 309 | except Exception: |
| 310 | return "" |
| 311 | |
| 312 | |
| 313 | def _extract_text_from_pdf_with_ocr(pdf_path: str) -> str: |
no outgoing calls
no test coverage detected