Why strategy="hi_res" Burns 100x CPU on Born-Digital PDFs
Rasterizing a 200-page technical specification at 200..300 DPI allocates multi-gigabyte RGB arrays per worker and runs object detection + OCR character recognition on text that pdfium / pypdfium2 extracts natively in 2 milliseconds per page with 100% character fidelity.
Immediate Python Fix: Page-Level Text-Stream Gate Before Invoking OCR
import pypdfium2 as pdfium
def needs_ocr(pdf_path: str, min_chars_per_page: int = 80) -> list[int]:
doc = pdfium.PdfDocument(pdf_path)
scanned_pages = []
for idx in range(len(doc)):
txt = doc[idx].get_textpage().get_text_range().strip()
if len(txt) < min_chars_per_page:
scanned_pages.append(idx)
return scanned_pages # Run OCR ONLY on scanned_pages; extract born-digital pages natively!
Single-Pipeline Structural Ingest + GPU Retrieval on Voxell Forge
Retire fragile poppler + tesseract + detectron2 Docker images (6+ GB container bloat) and per-page SaaS parser bills. Voxell Forge ingests PDFs, DOCX, PPTX, Markdown, and Git repos in one pipeline ($39/mo Builder annual; $199/mo Team annual).