Short, task-oriented recipes with a CLI command, Python equivalent, the flags used, expected output and the common mistake to avoid. Every recipe links to the official source.
from docling.document_converter import DocumentConverter
from docling.chunking import HybridChunker
converter = DocumentConverter()
result = converter.convert("report.pdf")
chunker = HybridChunker()
for chunk in chunker.chunk(result.document):
print(chunk.text)
Flags used
--to chunks Emits chunked output.
--chunks-type hybrid Uses HybridChunker.
Expected output
Chunks split on document structure rather than raw character counts.
Variations
Inspect the raw export
docling convert report.pdf --to json
Common mistake: Using a naive character splitter instead of structure-aware chunking, which breaks tables and headings.
Verified with Docling v2.129.0 · Last checked 2026-09-22 · Official source
1
Start here
How to use these examples
Ten copy-ready recipes for the most common Docling jobs. Each one includes a CLI command, the Python equivalent, the flags it uses, the expected output and the mistake to avoid.
Work through a recipe from top to bottom.
Find your task. Filter by category or search for a flag or keyword.
Copy the command. Use the Copy button on the CLI block, or copy the Python equivalent.
Run it. Commands write the converted file next to the source by default.
Check the output. Compare it against the expected output shown in the recipe.
Adapt it. Add flags from the recipe or build a custom command in the config generator.
2
Setup
Before you start
Every example assumes Docling is installed and you have a sample document ready.
Python 3.10 or newer is required.
OCR examples need an OCR engine; RapidOCR is a good CPU default.
The integration examples install a separate package.