What it does
Docling parses PDFs, office documents, HTML, and images into a unified document model. It can preserve layout, reading order, tables, and formulas while exporting Markdown or structured data.
Why it’s interesting
Document structure matters to retrieval: preserving headings and tables gives downstream chunkers more context than plain text extraction. Local processing can also help with sensitive files.
Real-world use case
Convert research papers before indexing them in a RAG system; keep section headings and tables attached to the relevant chunks.
What I can learn
- 01
Layout analysis
identify page regions and reading order.
- 02
Table recognition
reconstruct rows, columns, and spanning cells.
- 03
Structured chunking
split by document hierarchy instead of arbitrary character counts.
One thing to explore
Conversion pipeline
Follow the docling/pipeline implementation and connect it to the concepts above.
Explore the source (opens in a new tab)10-Minute Challenge
Parse a PDF into Markdown
Before you start: Python 3 and a local PDF file. First-run model downloads can make this take longer than ten minutes.
- Install Docling in a Python environment.
- Run the script against a PDF you are allowed to process.
- Inspect the first Markdown output and compare a table or heading to the source PDF.
pip install doclingfrom docling.document_converter import DocumentConverter
result = DocumentConverter().convert("paper.pdf")print(result.document.export_to_markdown()[:1000])