feat: enhance PDF text extraction and add maintenance features

- Refactor text extraction functions to extract text from all pages instead of just the first page.
- Implement logging for better debugging during file operations.
- Add a new maintenance page with options to rebuild the database and run consistency checks.
- Update styles for maintenance actions and improve UI elements.
- Remove obsolete rebuild database functionality from the main interface.
This commit is contained in:
2026-10-13 22:01:36 +02:00
parent ab232a276f
commit 34271f3bfa
13 changed files with 237 additions and 67 deletions
+3 -3
View File
@@ -24,7 +24,7 @@ from .config import (
MappingRule,
PeriodFormatConfig,
)
from .extractor import extract_first_page_text, is_text_empty, TextExtractionError
from .extractor import extract_document_text, is_text_empty, TextExtractionError
from .period import (
format_period_from_emission_date,
)
@@ -99,7 +99,7 @@ class DocumentProcessor:
result = ProcessingResult(success=False)
try:
# Step 1: Extract first page text
# Step 1: Extract document text
if extracted_text is None:
extracted_text = self._extract_text(pdf_bytes)
@@ -293,7 +293,7 @@ class DocumentProcessor:
Extracted text, or None if extraction fails.
"""
try:
text = extract_first_page_text(pdf_bytes)
text = extract_document_text(pdf_bytes)
if is_text_empty(text, self.min_text_length):
return None
return text