docling-project / docling-project/docling
Short isolated paragraphs dropped from extraction — layout model fails to detect small text blocks
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 84
Description
### Bug
Docling silently drops short, isolated single-line paragraphs from PDF text extraction. The text is visually present in the PDF and correctly extractable by `pymupdf`'s `get_text()`, but does not appear in Docling's output.
The specific line dropped: `UPDATE: Nedim testing the sync!!!` - a single short paragraph between a multi-line intro paragraph and a section heading.
This was tested with three different PDF variants:
- **Original PDF** (Type3 fonts from an HTML-to-PDF converter): line missing
- **Rebuilt PDF with standard Helvetica fonts** (via pymupdf): line missing
- **Image-only PDF** (rendered at 200 DPI, no text layer, forcing OCR): line missing
All three variants produce the same visual page, suggesting the issue is in the **layout detection model** (object detection on rendered images), not in text-layer parsing or font handling.
Pipeline options used:
```python
pipeline_options = PdfPipelineOptions(
do_ocr=True,
ocr_options=TesseractCliOcrOptions(lang=["eng"]),
do_table_structure=True,
)
```
Backend: PyPdfiumDocumentBackend
### Steps to reproduce
1. Use the attached `file_with_dropped_line.pdf`
2. Extract with Docling using default PDF pipeline with do_ocr=True
3. Check the output - the line "UPDATE: Nedim testing the sync!!!" on page 1 (between the intro paragraph and "Section 1: Access Control Requirements") is missing from all output
4. Verify with pymupdf: fitz.open("file.pdf")[0].get_text() - the line IS present
### File
[file_with_dropped_line.pdf](https://github.com/user-attachments/files/26624169/file_with_dropped_line.pdf)
### Docling version
2.64.0
### Python version
3.13
Contributor guide
Assessment
This issue has not been assessed yet.