MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _ocr_page_with_pymupdf_ocr

Function _ocr_page_with_pymupdf_ocr

skills/pdf-parser/scripts/parse_pdf.py:301–310  ·  view source on GitHub ↗
(page: Any)

Source from the content-addressed store, hash-verified

299
300
301def _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
313def _extract_text_from_pdf_with_ocr(pdf_path: str) -> str:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected