code issue fix

This commit is contained in:
Yaojia Wang
2026-01-17 18:55:46 +01:00
parent 510890d18c
commit e9460e9f34
9 changed files with 729 additions and 57 deletions

View File

@@ -57,6 +57,7 @@ def get_pdf_type(pdf_path: str | Path) -> PDFType:
return "scanned"
text_pages = 0
total_pages = len(doc)
for page in doc:
text = page.get_text().strip()
if len(text) > 30:
@@ -64,7 +65,6 @@ def get_pdf_type(pdf_path: str | Path) -> PDFType:
doc.close()
total_pages = len(doc)
if text_pages == total_pages:
return "text"
elif text_pages == 0: