Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Fixing error sentinel for pdftotext when the PDF has no text (scanned images). It was causing a crash previously.

Mattce98019b49d9
diff --git a/src/paperless_tesseract/parsers.py b/src/paperless_tesseract/parsers.py
index c90c9f020..43c898df5 100644
--- a/src/paperless_tesseract/parsers.py
+++ b/src/paperless_tesseract/parsers.py
@@ -235,6 +235,6 @@ def get_text_from_pdf(pdf_file):
try:
pdf = pdftotext.PDF(f)
except pdftotext.Error:
- return False
+ return ""
return "\n".join(pdf)