diff --git a/dangerzone/isolation_provider/base.py b/dangerzone/isolation_provider/base.py index 26d40a646..e761c23b5 100644 --- a/dangerzone/isolation_provider/base.py +++ b/dangerzone/isolation_provider/base.py @@ -101,7 +101,7 @@ def convert( self.print_progress(document, True, str(e), 0) document.mark_as_failed() - def _ocr_page(self, pixmap: fitz.Pixmap, ocr_lang: str) -> bytes: + def ocr_page(self, pixmap: fitz.Pixmap, ocr_lang: str) -> bytes: """Get a single page as pixels, OCR it, and return a PDF as bytes. This operation is particularly tricky, since we have to handle various PyMuPDF @@ -164,7 +164,7 @@ def _pixels_to_pdf( pixmap.set_dpi(DEFAULT_DPI, DEFAULT_DPI) if ocr_lang: # OCR the document - page_pdf_bytes = self._ocr_page(pixmap, ocr_lang) + page_pdf_bytes = self.ocr_page(pixmap, ocr_lang) else: # Don't OCR page_doc = fitz.Document() page_doc.insert_file(pixmap)