Convert PDF to Markdown
Basics Starter
Convert a local PDF into clean, structured Markdown.
docling convert report.pdf --to mdCopy
Flags, output & tips
Flags used --to md Export Markdown (the default output format).
Expected output # Annual Report
## Revenue
| Year | Revenue |
|------|--------:|
| 2025 | $12M |
| 2026 | $15M |
Variations Skip OCR for a digital PDF (much faster)
docling convert report.pdf --to md --no-ocr Copy
Write straight into a folder
docling convert report.pdf --to md --output ./outCopy
Common mistake: Running on a scanned PDF and getting empty text. If the PDF has no text layer, add --ocr-mode full_page.
Official docs → · PDF to JSON · Save to a folder
Convert a document from a URL
Basics Starter
Download and convert an online document directly from an HTTP(S) URL.
docling convert https://arxiv.org/pdf/2408.09869 --to mdCopy
Flags, output & tips
Expected output ## Docling Technical Report
The conversion pipeline analyses layout, reading order and tables…
Variations Send request headers (auth / token)
docling convert https://example.com/report.pdf --headers '{"Authorization" :"Bearer TOKEN" }' --to mdCopy
Export JSON instead
docling convert https://arxiv.org/pdf/2408.09869 --to jsonCopy
Common mistake: Assuming any URL works. The source must be a supported document format reachable over HTTP(S).
Official docs → · Supported formats
Export lossless JSON
Basics Starter
Export the full DoclingDocument JSON schema, including bounding boxes and reading order.
docling convert report.pdf --to jsonCopy
Flags, output & tips
Flags used --to json Lossless JSON representation of the document tree.
Expected output {
"schema_name": "DoclingDocument",
"texts": [ ... ],
"tables": [ ... ],
"pictures": [ ... ]
}
Variations Skip OCR for speed
docling convert report.pdf --to json --no-ocr Copy
Embed images as base64
docling convert report.pdf --to json --image-export-mode embeddedCopy
Common mistake: Expecting CLI JSON and export_to_dict() to be byte-identical; they are equivalent views of the same document.
Official docs → · PDF to Markdown · Export images as files
Check the installed version
Basics Starter
Print the Docling, docling-core and docling-ibm-models versions.
docling --version Copy
Flags, output & tips
Flags used --version Shows Docling, docling-core and docling-ibm-models versions.
Expected output Docling version: 2.129.0
Docling Core version: 2.x.x
Docling IBM Models version: 3.x.x
Python: cpython-312 …
Variations Upgrade to the latest release
pip install -U docling docling-core docling-ibm-modelsCopy
Common mistake: Reporting a bug without the version output — always include it, since flags change between releases.
Official docs → · Troubleshooting
Read the built-in help
Basics Starter
List every flag the installed Docling version supports, straight from the CLI.
docling convert --help Copy
Flags, output & tips
Expected output Usage: docling convert [OPTIONS] SOURCE
--from TEXT Input formats to accept…
--to TEXT Output formats…
--ocr-engine TEXT The OCR engine to use…
Variations List the top-level commands
docling --help Copy
Inspect the remote converter
docling convert-remote --help Copy
Common mistake: Trusting old blog posts. Always confirm flags with --help for your installed version.
Official docs → · Full flag reference
Save results to a folder
Basics Starter
Write converted files into a specific output directory instead of the current one.
docling convert report.pdf --to md --output ./outCopy
Flags, output & tips
Flags used --output Directory where results are written (default: current directory).
Expected output ./out/report.md
Variations Export several formats at once
docling convert report.pdf --to md --to json --to html --output ./outCopy
Common mistake: Forgetting that --output takes a directory, not a file name. Combine it with --to to choose the extension.
Official docs → · Convert a whole folder · Multiple output formats
Export several formats at once
Output Intermediate
The --to flag is repeatable: produce Markdown, JSON and HTML in a single run.
docling convert report.pdf --to md --to json --to htmlCopy
Flags, output & tips
Flags used --to Repeatable. Available: md, json, yaml, html, html_split_page, text, doctags, vtt, doclang, dclx, chunks, latex.
Expected output report.md report.json report.html
Variations Everything into one folder
docling convert report.pdf --to md --to json --output ./outCopy
Common mistake: Passing a comma-separated list (--to md,json). Repeat the flag instead.
Official docs → · Output format reference
Convert an entire folder
Basics Intermediate
Point Docling at a directory and it walks every supported document inside it.
docling convert ./inbox --output ./outCopy
Flags, output & tips
Flags used --output Folder for the converted results.--abort-on-error Optional: stop at the first file that fails.
Expected output Converting ./inbox/a.pdf … done
Converting ./inbox/b.docx … done
Variations Keep going even if one file fails
docling convert ./inbox --output ./out --no-abort-on-error Copy
Filter to one format
docling convert ./inbox --from pdf --output ./outCopy
Common mistake: Expecting recursion into sub-folders to always be desired — check the printed file list before a big run.
Official docs → · Convert many explicit files · Batch recipes
Convert several named files
Basics Intermediate
Pass multiple paths in one command; each is converted independently.
docling convert a.pdf b.docx c.pptx --output ./outCopy
Flags, output & tips
Flags used source Accepts one or more local paths, directories or URLs.
Expected output a.md b.md c.md written to ./out
Variations Mixed sources including a URL
docling convert a.pdf https://example.com/b.pdf --output ./outCopy
Common mistake: Quoting a glob ("*.pdf") and expecting the shell to expand it — let the shell expand it, or pass the directory.
Official docs → · Convert a whole folder
Pre-download all models
Offline & models Intermediate
Cache layout, table, OCR and enrichment models locally before first use or offline runs.
docling-tools models download --all Copy
Flags, output & tips
Flags used --all Download every available model (large).
Expected output Downloading layout model…
Downloading tableformer model…
Models cached in $HOME/.cache/docling/models
Variations Download only what you need
docling-tools models download layout tableformer rapidocrCopy
Download a HuggingFace repo
docling-tools models download-hf-repo docling-project/docling-modelsCopy
Common mistake: Downloading --all on a metered connection — pick the specific models you use.
Official docs → · Point at an artifacts path · Run fully offline
Convert DOCX to Markdown
Formats Starter
Parse Microsoft Word documents, preserving headings, lists and tables.
docling convert contract.docx --to mdCopy
Flags, output & tips
Expected output # Service Agreement
1. Scope
2. Payment terms…
Variations Legacy .doc files
docling convert contract.doc --to mdCopy
Common mistake: Expecting OCR options to matter — Office formats are parsed natively, so --ocr-engine has no effect.
Official docs → · All input formats
Convert PPTX to Markdown
Formats Starter
Extract slide text boxes, titles and speaker notes from PowerPoint decks.
docling convert slides.pptx --to mdCopy
Flags, output & tips
Flags used --page-range Optional: convert only e.g. the first slides (1-5).
Expected output ## Slide 1 — Overview
Bullet one
Bullet two
Variations Only the first ten slides
docling convert slides.pptx --page-range 1-10 --to mdCopy
Common mistake: Assuming images inside slides are described — add --enrich-picture-description for that.
Official docs → · Enrich picture descriptions · Convert a page range
Convert XLSX to Markdown
Formats Starter
Parse Excel workbooks sheet by sheet into structured tables.
docling convert workbook.xlsx --to mdCopy
Flags, output & tips
Flags used --page-range Optional: limit which sheets are converted.
Expected output ## Sheet 1
| Region | Q1 | Q2 |
|--------|----|----|
| EMEA | 12 | 15 |
Variations Lossless structure
docling convert workbook.xlsx --to jsonCopy
Common mistake: Treating XLSX like a PDF and enabling OCR — spreadsheets have no bitmap pages by default.
Official docs → · Output format reference
Convert HTML to Markdown
Formats Starter
Parse saved HTML pages or local .html files into Markdown.
docling convert page.html --to mdCopy
Flags, output & tips
Flags used --html-image-fetch Fetch images referenced by HTML/EPUB (none, local, remote, all).
Expected output # Page title
Body text converted from HTML…
Variations Download remote images too
docling convert page.html --html-image-fetch remote --to mdCopy
Common mistake: Forgetting image fetching is off by default; pass --html-image-fetch if you need the pictures.
Official docs → · Supported formats
Convert CSV to Markdown
Formats Starter
Turn comma-separated data into a Markdown table.
docling convert data.csv --to mdCopy
Flags, output & tips
Flags used --to md Markdown table output.
Expected output | name | score |
|------|------:|
| Ada | 98 |
Variations Keep it as structured JSON
docling convert data.csv --to jsonCopy
Common mistake: Using a delimiter other than a comma/standard CSV dialect — normalise it first.
Official docs → · Supported formats
Convert EPUB to Markdown
Formats Intermediate
Convert e-books and long-form EPUB content while keeping chapter structure.
docling convert book.epub --to mdCopy
Flags, output & tips
Flags used --html-image-fetch Fetch images embedded in the EPUB.
Expected output # Chapter 1
Long-form text…
Variations Include the illustrations
docling convert book.epub --html-image-fetch all --to mdCopy
Common mistake: Not fetching images and then wondering why figures are missing.
Official docs → · Supported formats
Convert Markdown to HTML
Formats Intermediate
Reprocess a Markdown file and export clean HTML (tables and code preserved).
docling convert notes.md --to htmlCopy
Flags, output & tips
Expected output <h1>Notes</h1>
<p>…</p>
Variations Split long pages
docling convert notes.md --to html_split_pageCopy
Common mistake: Expecting image files to be authored — HTML export references boxes, it does not render new images.
Official docs → · Output format reference
Convert LaTeX to Markdown
Formats Advanced
Parse LaTeX sources, with optional TikZ diagram rendering.
docling convert paper.tex --to mdCopy
Flags, output & tips
Flags used --tikz-engine Set to 'tectonic' to rasterize tikzpicture diagrams.
Expected output # Introduction
The math is preserved as LaTeX where possible…
Variations Render TikZ diagrams to images
docling convert paper.tex --tikz-engine tectonic --to mdCopy
Common mistake: TikZ rendering silently falls back to keeping the source when Tectonic is missing or fails.
Official docs → · Supported formats
OCR a single image
OCR Intermediate
Convert a PNG/JPEG/TIFF image of text into Markdown using OCR.
docling convert scan.png --to md --ocr-mode full_pageCopy
Flags, output & tips
Flags used --ocr-mode full_page OCR the whole image.--ocr-engine Optionally pick a specific engine.
Expected output Text recognised from the image…
Variations Use RapidOCR
docling convert scan.png --ocr-engine rapidocr --to mdCopy
Common mistake: Using the default OCR mode on a low-DPI photo: increase resolution for better accuracy.
Official docs → · OCR a scanned PDF · Compare OCR engines
OCR a scanned PDF
OCR Starter
Force full-page OCR on image-only pages that have no selectable text.
docling convert scan.pdf --ocr-mode full_page --to mdCopy
Flags, output & tips
Flags used --ocr-mode full_page OCR every page from its rendered image and replace detected text.
Expected output Text reconstructed from the scanned page images…
Variations Pick the engine at the same time
docling convert scan.pdf --ocr-mode full_page --ocr-engine rapidocr --to mdCopy
Common mistake: Leaving OCR on for digital PDFs wastes time. Only force it when the text layer is missing or wrong.
Official docs → · Disable OCR for digital PDFs · Legacy --force-ocr migration
Choose an OCR engine
OCR Intermediate
Run OCR with a specific engine instead of the automatic choice.
docling convert scan.pdf --ocr-engine rapidocr --to mdCopy
Flags, output & tips
Flags used --ocr-engine auto, easyocr, rapidocr, tesserocr, tesseract, ocrmac, nemotron-ocr, kserve_v2_ocr.
Expected output Using OCR engine: rapidocr
Variations Tesseract with a language
docling convert scan.pdf --ocr-engine tesseract --ocr-lang eng --to mdCopy
Apple Vision on macOS
docling convert scan.pdf --ocr-engine ocrmac --to mdCopy
Common mistake: Choosing an engine that is not installed. RapidOCR is the safest cross-platform default.
Official docs → · Compare OCR engines · Multilingual OCR
OCR in a specific language
OCR Intermediate
Tell the OCR engine which language(s) to expect for much better accuracy.
docling convert scan.pdf --ocr-engine tesseract --ocr-lang deu,fra --to mdCopy
Flags, output & tips
Flags used --ocr-lang Comma-separated native engine codes (e.g. deu,fra) or BCP-47 tags prefixed with iso: (e.g. iso:zh-Hans).
Expected output Using OCR languages: deu, fra
Variations Simplified Chinese via BCP-47
docling convert scan.pdf --ocr-engine rapidocr --ocr-lang iso:zh-Hans --to mdCopy
Let the engine auto-detect
docling convert scan.pdf --ocr-lang '' --to mdCopy
Common mistake: Mixing engine conventions. Each engine has its own codes — prefix canonical BCP-47 tags with iso:.
Official docs → · Compare OCR engines
Disable OCR (digital PDFs)
OCR Starter
Skip OCR entirely for PDFs that already contain a text layer — often several times faster.
docling convert report.pdf --no-ocr --to mdCopy
Flags, output & tips
Flags used --no-ocr Turn OCR off; the embedded text layer is used as-is.
Expected output Skipping OCR (digital text layer detected)…
Variations Also skip tables you do not need
docling convert report.pdf --no-ocr --no-tables --to mdCopy
Common mistake: Using --no-ocr on a scan: you will get empty or near-empty output.
Official docs → · OCR a scanned PDF · Performance guide
OCR only layout regions
OCR Advanced
Run OCR just on detected layout regions instead of the full page.
docling convert report.pdf --ocr-mode layout_regions --to mdCopy
Flags, output & tips
Flags used --ocr-mode layout_regions Feed detected layout regions to the OCR engine.
Expected output OCR applied to detected layout regions…
Variations PDF-aware region selection
docling convert report.pdf --ocr-mode pdf_aware_layout_regions --to mdCopy
Common mistake: Using region modes when the whole page is one photo — use full_page there instead.
Official docs → · OCR a scanned PDF
Set the Tesseract page segmentation mode
OCR Advanced
Fine-tune Tesseract layout analysis with a page segmentation mode (0-13).
docling convert scan.pdf --ocr-engine tesseract --psm 6 --to mdCopy
Flags, output & tips
Flags used --psm Page Segmentation Mode (0-13). Applies to Tesseract engines.
Expected output Tesseract PSM 6 — assume a single uniform block of text.
Variations Single line of text
docling convert scan.pdf --ocr-engine tesseract --psm 7 --to mdCopy
Common mistake: Setting PSM for non-Tesseract engines where it is ignored.
Official docs → · Choose an OCR engine
Faster table extraction
Tables Intermediate
Use the fast table mode instead of the accurate model when speed matters.
docling convert report.pdf --table-mode fast --to mdCopy
Flags, output & tips
Flags used --table-mode accurate (TableFormer, default) or fast.
Expected output Rough table grid, produced faster…
Variations Skip tables entirely
docling convert report.pdf --no-tables --to mdCopy
Common mistake: Using fast on financial sheets with merged cells — accuracy drops noticeably.
Official docs → · Disable tables
Disable table extraction
Tables Intermediate
Skip the table structure model when you only need prose text.
docling convert report.pdf --no-tables --to mdCopy
Flags, output & tips
Flags used --no-tables Do not run the table structure model.
Expected output Tables rendered as plain text flow…
Variations Fastest digital text path
docling convert report.pdf --no-ocr --no-tables --to mdCopy
Common mistake: Enabling it when tables matter — table content will collapse into paragraphs.
Official docs → · Faster table extraction
Use the TableFormer v2 engine
Tables Advanced
Select a specific table structure engine, including newer TableFormer v2.
docling convert report.pdf --table-structure-engine docling_tableformer_v2 --to mdCopy
Flags, output & tips
Flags used --table-structure-engine docling_tableformer (default), docling_tableformer_v2, granite_vision_table.
Expected output Using table structure engine: docling_tableformer_v2
Variations Granite vision table engine
docling convert report.pdf --table-structure-engine granite_vision_table --to mdCopy
Common mistake: Assuming every engine is bundled — some require extra model downloads or plugins.
Official docs → · Faster table extraction
Enable code and formula enrichment
Enrichment Intermediate
Detect code blocks and extract LaTeX formulas with enrichment models.
docling convert paper.pdf --enrich-code --enrich-formula --to mdCopy
Flags, output & tips
Flags used --enrich-code Detect and label code blocks.--enrich-formula Extract formulas as LaTeX.
Expected output ```python
def hello(): …
```
$$ E = mc^2 $$
Variations Only formulas
docling convert paper.pdf --enrich-formula --to mdCopy
Only code
docling convert repo.pdf --enrich-code --to mdCopy
Common mistake: Enabling both on documents without code or math — each adds a neural pass and slows conversion.
Official docs → · Enrich picture descriptions · Extract chart data
Describe pictures with a VLM
Enrichment Advanced
Generate natural-language descriptions for figures and images.
docling convert report.pdf --enrich-picture-description --to mdCopy
Flags, output & tips
Flags used --enrich-picture-description Run a picture-description model over detected pictures.
Expected output <!-- picture: a bar chart showing revenue growth from 2020 to 2026 -->
Variations Cap generated tokens
docling convert report.pdf --enrich-picture-description --picture-description-max-new-tokens 256 --to mdCopy
Common mistake: Running it on image-heavy documents without enough RAM/VRAM — it loads a vision model.
Official docs → · Classify pictures
Classify pictures
Enrichment Advanced
Label pictures by class (chart, diagram, screenshot, photo…) with a classifier model.
docling convert report.pdf --enrich-picture-classes --to mdCopy
Flags, output & tips
Flags used --enrich-picture-classes Run the picture classification model.
Expected output <!-- picture class: chart -->
Variations Classify and describe
docling convert report.pdf --enrich-picture-classes --enrich-picture-description --to mdCopy
Common mistake: Expecting pixel-perfect labels — it is a lightweight classifier, not a full vision model.
Official docs → · Describe pictures
Chunk for RAG (hybrid)
RAG Intermediate
Export HybridChunker chunks that preserve headings, tables and metadata for vector stores.
docling convert report.pdf --to chunks --chunks-type hybridCopy
Flags, output & tips
Flags used --to chunks Export RAG-ready chunks.--chunks-type hybrid (default) or hierarchical.
Expected output { "text": "…", "meta": { "headings": ["Revenue"] } }
Variations Cap chunk size
docling convert report.pdf --to chunks --chunks-max-tokens 512Copy
Hierarchical chunks
docling convert report.pdf --to chunks --chunks-type hierarchicalCopy
Common mistake: Chunking the Markdown export with a naive splitter instead of using Docling's structure-aware chunker.
Official docs → · RAG guide · Chunks max tokens
Set the chunk size
RAG Advanced
Control the maximum tokens per chunk and the tokenizer used for hybrid chunking.
docling convert report.pdf --to chunks --chunks-max-tokens 512Copy
Flags, output & tips
Flags used --chunks-max-tokens Max tokens per chunk (defaults to the tokenizer's limit).--chunks-tokenizer HuggingFace tokenizer (default sentence-transformers/all-MiniLM-L6-v2).
Expected output Chunks sized to the embedding model's token limit…
Variations Match another embedding model
docling convert report.pdf --to chunks --chunks-tokenizer BAAI/bge-small-en-v1.5Copy
Common mistake: Setting a chunk size larger than your embedding model supports — it will be truncated.
Official docs → · Chunk for RAG
Convert with the Granite VLM
VLM Advanced
Use the vision-language pipeline with IBM's Granite Docling model for complex layouts.
docling convert report.pdf --pipeline vlm --vlm-model granite_docling --to mdCopy
Flags, output & tips
Flags used --pipeline vlm Select the VLM pipeline.--vlm-model Preset: granite_docling (default), smoldocling, deepseek_ocr, granite_vision, and more.
Expected output Markdown generated page-by-page by the vision model…
Variations Smaller SmolDocling preset
docling convert report.pdf --pipeline vlm --vlm-model smoldocling --to mdCopy
Keep the raw model output
docling convert report.pdf --pipeline vlm --vlm-write-native-output Copy
Common mistake: Assuming VLM is always better — for plain digital PDFs the standard pipeline is faster and cheaper.
Official docs → · Vision model guide · Standard PDF to Markdown
Cap VLM generation length
VLM Advanced
Override the maximum number of tokens the VLM may generate per page.
docling convert report.pdf --pipeline vlm --vlm-max-new-tokens 8192 --to mdCopy
Flags, output & tips
Flags used --vlm-max-new-tokens Override max_new_tokens for VLM generation.
Expected output Long, dense pages no longer get cut off…
Variations Keep raw output for debugging
docling convert report.pdf --pipeline vlm --vlm-write-native-output Copy
Common mistake: Leaving the default on very dense pages can truncate the page output.
Official docs → · Convert with the Granite VLM
Transcribe audio (ASR)
Audio & Video Intermediate
Transcribe WAV/MP3 audio into Markdown with the ASR pipeline.
docling convert lecture.mp3 --pipeline asr --to mdCopy
Flags, output & tips
Flags used --pipeline asr Select the speech-recognition pipeline.--asr-model Whisper size: whisper_tiny (default) … whisper_large.
Expected output 00:00:00 — Welcome to the show…
Variations Better accuracy
docling convert lecture.mp3 --pipeline asr --asr-model whisper_medium --to mdCopy
Subtitles output
docling convert lecture.mp3 --pipeline asr --to vttCopy
Common mistake: Using the default whisper_tiny for an important transcript; pick medium/large for accuracy.
Official docs → · Transcribe video · Audio & video guide
Transcribe video to subtitles
Audio & Video Intermediate
Transcribe a video's audio and export WebVTT subtitles with timestamps.
docling convert talk.mp4 --pipeline asr --to vttCopy
Flags, output & tips
Flags used --to vtt WebVTT subtitle output with timestamps.
Expected output WEBVTT
00:00:00.000 --> 00:00:04.000
Hello and welcome…
Variations Different ASR model
docling convert talk.mp4 --pipeline asr --asr-model whisper_small --to vttCopy
Common mistake: Expecting OCR/table flags to apply — video uses the ASR pipeline only.
Official docs → · Transcribe audio
Sample video by scene changes
Audio & Video Advanced
Choose how frames are sampled from video: a fixed interval or scene changes.
docling convert talk.mp4 --pipeline asr --video-sampling-mode sceneCopy
Flags, output & tips
Flags used --video-sampling-mode fixed (default) or scene.--video-frame-interval Seconds between frames in fixed mode (default 10).
Expected output Frames sampled at scene changes…
Variations Denser fixed sampling
docling convert talk.mp4 --pipeline asr --video-frame-interval 5Copy
Common mistake: Using scene mode on a single static camera — fixed interval is more predictable there.
Official docs → · Transcribe video
Speaker diarization (who said what)
Audio & Video Advanced
Label speakers in audio/video transcripts (requires the resemblyzer extra).
docling convert interview.mp4 --pipeline asr --video-diarization Copy
Flags, output & tips
Flags used --video-diarization Enable speaker diarization; requires resemblyzer.
Expected output [SPEAKER_00] …
[SPEAKER_01] …
Variations Disable diarization explicitly
docling convert interview.mp4 --pipeline asr --no-video-diarization Copy
Common mistake: Forgetting that diarization needs the resemblyzer dependency installed.
Official docs → · Transcribe audio
Export images as PNG files
Output Intermediate
Write figures out as separate PNG files and reference them from the output document.
docling convert report.pdf --to md --image-export-mode referenced --output ./outCopy
Flags, output & tips
Flags used --image-export-mode embedded (base64, default), placeholder, or referenced (PNG files).
Expected output ./out/report.md + ./out/report_artifacts/*.png
Variations Only mark image positions
docling convert report.pdf --to md --image-export-mode placeholderCopy
Embed as base64
docling convert report.pdf --to json --image-export-mode embeddedCopy
Common mistake: Using referenced with --to json and expecting the PNGs next to it — check the artifacts folder.
Official docs → · Lossless JSON
Export DocTags
Output Advanced
Produce compact token-style DocTags markup used as model input.
docling convert report.pdf --to doctagsCopy
Flags, output & tips
Flags used --to doctags DocTags markup output.
Expected output <doctag><page_1><section_header_level_1>Annual Report</section_header_level_1>…
Variations With VLM-native output
docling convert report.pdf --pipeline vlm --to doctagsCopy
Common mistake: Treating DocTags like Markdown — it is a compact internal representation for models.
Official docs → · Output format reference
Export paginated HTML
Output Advanced
Produce HTML split per page — handy for viewers and side-by-side review.
docling convert report.pdf --to html_split_page --output ./outCopy
Flags, output & tips
Flags used --to html_split_page One HTML file per page.
Expected output ./out/report_1.html report_2.html …
Variations Single-file HTML
docling convert report.pdf --to htmlCopy
Common mistake: Looking for a single HTML file when split output writes one per page.
Official docs → · Output format reference
Visualise detected layout
Output Advanced
Overlay detected item bounding boxes on page images in the output.
docling convert report.pdf --show-layout --to md --output ./outCopy
Flags, output & tips
Flags used --show-layout Show item bounding boxes on page images.
Expected output Page images with coloured layout boxes…
Variations Visualise table cells
docling convert report.pdf --debug-visualize-tables Copy
Common mistake: Expecting boxes drawn on the Markdown itself — they are drawn on exported page images.
Official docs → · Debug visualisers
Run on an NVIDIA GPU (CUDA)
Performance Intermediate
Accelerate inference with CUDA and tune thread/batch settings.
docling convert report.pdf --device cuda --num-threads 8 --to mdCopy
Flags, output & tips
Flags used --device cuda Use the NVIDIA GPU.--num-threads CPUs used for model inference (default 4).
Expected output Using accelerator device: cuda
Variations Larger page batches
docling convert big.pdf --device cuda --page-batch-size 16Copy
Common mistake: Passing --device cuda on a machine with no CUDA runtime; use auto or cpu instead.
Official docs → · Apple Silicon (MPS) · GPU troubleshooting
Run on Apple Silicon (MPS)
Performance Intermediate
Use the Metal backend on M-series Macs for accelerated inference.
docling convert report.pdf --device mps --to mdCopy
Flags, output & tips
Flags used --device mps Use Apple Metal Performance Shaders.
Expected output Using accelerator device: mps
Variations Let Docling choose
docling convert report.pdf --device auto --to mdCopy
Common mistake: Expecting MPS to match a discrete GPU — it is a solid speed-up, not a data-centre card.
Official docs → · Run on CUDA
Increase the page batch size
Performance Advanced
Process more pages per batch to raise GPU/CPU throughput on large documents.
docling convert big.pdf --page-batch-size 16 --to mdCopy
Flags, output & tips
Flags used --page-batch-size Pages processed in one batch (default 4).
Expected output Processing 16 pages per batch…
Variations Back off if you run out of memory
docling convert big.pdf --page-batch-size 2Copy
Common mistake: Raising it until you hit an out-of-memory error — lower it if conversion crashes.
Official docs → · Run on CUDA
Set a per-document timeout
Performance Advanced
Protect a batch from a single pathological file by capping processing time.
docling convert ./inbox --document-timeout 120 --output ./outCopy
Flags, output & tips
Flags used --document-timeout Timeout per document, in seconds.
Expected output Timed out after 120s — moving to the next file…
Variations Abort the whole batch on failure
docling convert ./inbox --abort-on-error --output ./outCopy
Common mistake: Setting a very short timeout on huge documents and getting false failures.
Official docs → · Convert a whole folder
Profile the conversion pipeline
Performance Advanced
Summarise where time is spent across conversion stages to find bottlenecks.
docling convert report.pdf --profiling --to mdCopy
Flags, output & tips
Flags used --profiling Summarise profiling details for all stages.--save-profiling Save profiling summaries to JSON.
Expected output layout: 3.2s ocr: 1.1s tableformer: 0.9s total: 5.4s
Variations Save the numbers to JSON
docling convert report.pdf --profiling --save-profiling Copy
Common mistake: Profiling with -v left on and mistaking logging time for model time.
Official docs → · Performance guide
Convert only a page range
Formats Intermediate
Parse a subset of pages instead of the whole document.
docling convert report.pdf --page-range 1-4 --to mdCopy
Flags, output & tips
Flags used --page-range e.g. 1-4 (page numbers start at 1). Honoured by PDF, XLSX and PPTX.
Expected output Converting pages 1-4 only…
Variations Single page
docling convert report.pdf --page-range 3 --to mdCopy
Common mistake: Expecting all backends to honour the range — mainly PDF, XLSX and PPTX.
Official docs → · Password-protected PDFs
Open a password-protected PDF
Formats Advanced
Supply a password so encrypted PDFs can be converted.
docling convert locked.pdf --pdf-password 'secret' --to mdCopy
Flags, output & tips
Flags used --pdf-password Password for protected PDF documents.
Expected output Decrypting and converting locked.pdf…
Variations Use a password from an environment variable
docling convert locked.pdf --pdf-password "$PDF_PW" --to mdCopy
Common mistake: Putting a real password in shell history; prefer an environment variable.
Official docs → · Convert a page range
Switch the PDF backend
Formats Advanced
Choose between the default docling-parse backend and pypdfium2 for problem PDFs.
docling convert report.pdf --pdf-backend pypdfium2 --to mdCopy
Flags, output & tips
Flags used --pdf-backend docling_parse (default) or pypdfium2.
Expected output Using PDF backend: pypdfium2
Variations Default parser
docling convert report.pdf --pdf-backend docling_parse --to mdCopy
Common mistake: Sticking with the default on PDFs with broken font encodings — try pypdfium2.
Official docs → · Troubleshooting
Use a custom models path
Offline & models Advanced
Point Docling at a pre-populated model directory instead of the default cache.
docling convert report.pdf --artifacts-path /opt/docling/models --to mdCopy
Flags, output & tips
Flags used --artifacts-path Location of pre-downloaded model artifacts.
Expected output Loading models from /opt/docling/models…
Variations Use an environment variable instead
DOCLING_ARTIFACTS_PATH=/opt/docling/models docling convert report.pdf --to mdCopy
Common mistake: Pointing at an empty directory: Docling then tries to download and may fail offline.
Official docs → · Pre-download models · Run fully offline
Run fully offline (air-gapped)
Offline & models Advanced
Prefetch models on a connected host, then convert with no network access.
export HF_HUB_OFFLINE=1; export DOCLING_ARTIFACTS_PATH=/opt/docling/models; docling convert report.pdf --to mdCopy
Flags, output & tips
Flags used DOCLING_ARTIFACTS_PATH Directory holding the pre-downloaded models.HF_HUB_OFFLINE Stop HuggingFace downloads and use the local cache only.
Expected output Conversion completes with no outbound requests…
Variations Choose the HF cache directory
export HF_HOME=/opt/docling/hf; docling convert report.pdf --to mdCopy
Common mistake: Forgetting HF_HUB_OFFLINE=1, which makes Docling attempt a network fetch and stall or fail.
Official docs → · Pre-download models
Run the Docling Serve API
Serve Intermediate
Start the docling-serve HTTP API and interactive UI on port 5001.
docling-serve run --enable-ui Copy
Flags, output & tips
Flags used --enable-ui Serve the built-in web UI alongside the API.
Expected output Uvicorn running on http://0.0.0.0:5001 (docs at /docs)
Variations Run in Docker
docker run -p 5001:5001 -e DOCLING_SERVE_ENABLE_UI=1 quay.io/docling-project/docling-serveCopy
Common mistake: Exposing the service publicly without authentication — front it with a proxy and auth.
Official docs → · Convert via a remote service · docling-serve docs
Convert through a remote service
Serve Advanced
Offload conversion to a running docling-serve instance (local files, folders or URLs).
docling convert-remote report.pdf --service-url http://localhost:5001 --to mdCopy
Flags, output & tips
Flags used --service-url Base URL of docling-serve (or DOCLING_SERVICE_URL).--api-key Optional API key (or DOCLING_SERVICE_API_KEY).
Expected output submitting job… polling… report.md written
Variations Authenticated service
docling convert-remote report.pdf --service-url https://docling.internal --api-key "$DOCLING_KEY" --to mdCopy
Use polling instead of websocket
docling convert-remote report.pdf --service-url http://localhost:5001 --watcher polling --to mdCopy
Common mistake: Passing local-only flags like --device to convert-remote; they are intentionally absent.
Official docs → · Run the Docling Serve API
Run the MCP server
MCP Intermediate
Expose Docling to AI desktop clients (Claude Desktop, LM Studio) over the Model Context Protocol.
uvx --from =docling-mcp docling-mcp-serverCopy
Flags, output & tips
Flags used --from=docling-mcp Runs the MCP server package without a global install.
Expected output docling-mcp server ready (stdio)
Variations JSON config for an AI client
{"mcpServers" : {"docling" : {"command" : "uvx" , "args" : ["--from =docling-mcp" , "docling-mcp-server" ]}}}Copy
Common mistake: Pasting the command instead of the JSON block into the client's MCP configuration.
Official docs → · MCP guide
Increase log verbosity
Debug Intermediate
Print progress (-v) or full debug logging (-vv) to diagnose a conversion.
docling convert report.pdf -vv --to mdCopy
Flags, output & tips
Flags used -v / --verbose Repeat for more detail: -v info, -vv debug.-q / --quiet Silence per-file progress (warnings and errors remain).
Expected output DEBUG docling.pipeline… loading layout model
Variations Silent batch for scripting
docling convert ./inbox --quiet --output ./outCopy
Common mistake: Leaving -vv on in production — debug logging is slow and very noisy.
Official docs → · Debug visualisers
Visualise cells, OCR and tables
Debug Advanced
Debug visualisers render what each stage detected, for tuning and troubleshooting.
docling convert report.pdf --debug-visualize-tables Copy
Flags, output & tips
Flags used --debug-visualize-layout Visualise layout clusters.--debug-visualize-tables Visualise table cells.--debug-visualize-ocr Visualise OCR cells.--debug-visualize-cells Visualise PDF cells.
Expected output Annotated page images written next to the output…
Variations Inspect OCR detection
docling convert scan.pdf --debug-visualize-ocr Copy
Inspect layout clusters
docling convert report.pdf --debug-visualize-layout Copy
Common mistake: Using several visualisers at once and getting an overwhelming number of images.
Official docs → · Increase log verbosity