893 B
893 B
LibreOffice PDF→DOCX fallback
Why deferred
We already convert .doc → .docx via LibreOffice. PDF→DOCX is tempting for “reuse the DOCX parser,” but styles/fonts often come out wrong — fighting the reason we chose PyMuPDF.
Trigger
Heading Reconstruction on PyMuPDF has an unacceptable false-positive/false-negative rate on a representative sample, and bookmarks/fonts are absent.
Approach to try
- Optional fallback:
soffice --headless --convert-to docxthen existingparse_docx - Compare markdown side-by-side (PyMuPDF vs converted DOCX) in Chunk Preview before making it default
- Keep as opt-in or auto-fallback only when PDF outline + font variance is below a threshold
Success criteria
- Converted DOCX headings beat PyMuPDF heuristics on the failing sample set
- Conversion time acceptable for upload UX (or async later — currently sync REST)