Docling コマンド検索

よく使う Docling のタスクと正確なコマンド。検索、カテゴリ絞り込み、コピーができます。コマンドは現在の docling convert 構文を使用しています。必ず公式ドキュメントで確認してください。

PDFをMarkdownに変換

BasicStarter

ローカルのPDFを構造化Markdownに変換します。

docling convert report.pdf --to md
フラグ、出力、ヒント

使用するフラグ

  • --to md 出力形式。フラグを繰り返すと複数の形式を一度にエクスポートできます。

期待される出力

# Annual Report

## Revenue

| Year | Revenue |
|------|--------:|
| 2025 | $12M |
| 2026 | $15M |

バリエーション

デジタル PDF で OCR をスキップ(大幅に高速)

docling convert report.pdf --to md --no-ocr

フォルダに直接書き込む

docling convert report.pdf --to md --output ./out

よくある間違い: スキャンした PDF で実行して空のテキストになる。PDF にテキスト層がない場合は --ocr-mode full_page を追加します。

URLから文書を変換

BasicStarter

オンライン文書をHTTP URLから直接ダウンロードして変換します。

docling convert https://arxiv.org/pdf/2408.09869 --to md
フラグ、出力、ヒント

使用するフラグ

  • --to md 出力形式。フラグを繰り返すと複数の形式を一度にエクスポートできます。

期待される出力

## Docling Technical Report

The conversion pipeline analyses layout, reading order and tables…

バリエーション

リクエストヘッダーを送信(auth / token)

docling convert https://example.com/report.pdf --headers '{"Authorization":"Bearer TOKEN"}' --to md

代わりに JSON をエクスポート

docling convert https://arxiv.org/pdf/2408.09869 --to json

よくある間違い: どの URL でも動くと想定する。ソースは HTTP(S) 経由で到達可能な対応ドキュメント形式である必要があります。

ロスレスJSONを出力

BasicStarter

バウンディングボックスを含むDoclingDocumentのJSONスキーマを出力します。

docling convert report.pdf --to json
フラグ、出力、ヒント

使用するフラグ

  • --to json 出力形式。フラグを繰り返すと複数の形式を一度にエクスポートできます。

期待される出力

{
  "schema_name": "DoclingDocument",
  "texts": [ ... ],
  "tables": [ ... ],
  "pictures": [ ... ]
}

バリエーション

速度のために OCR をスキップ

docling convert report.pdf --to json --no-ocr

画像を base64 として埋め込む

docling convert report.pdf --to json --image-export-mode embedded

よくある間違い: CLI の JSON と export_to_dict() がバイト単位で同一だと期待する。両者は同じドキュメントの等価な表現です。

インストール済みバージョンを確認

BasicStarter

Docling、docling-core、docling-ibm-models のバージョンを表示します。

docling --version
フラグ、出力、ヒント

使用するフラグ

  • --version インストールされている Docling のバージョンを表示します。

期待される出力

Docling version: 2.129.0
Docling Core version: 2.x.x
Docling IBM Models version: 3.x.x
Python: cpython-312 …

バリエーション

最新リリースにアップグレード

pip install -U docling docling-core docling-ibm-models

よくある間違い: バージョン出力なしで不具合を報告する。リリース間でフラグが変わるため、常に含めてください。

組み込みヘルプを読む

BasicStarter

インストール済み Docling バージョンが対応するすべてのフラグを CLI から直接一覧表示します。

docling convert --help
フラグ、出力、ヒント

期待される出力

Usage: docling convert [OPTIONS] SOURCE

  --from TEXT        Input formats to accept…
  --to TEXT          Output formats…
  --ocr-engine TEXT  The OCR engine to use…

バリエーション

トップレベルのコマンドを一覧表示

docling --help

リモートコンバーターを確認

docling convert-remote --help

よくある間違い: 古いブログ記事を信用する。インストール済みバージョンのフラグは常に --help で確認してください。

結果をフォルダに保存

BasicStarter

変換したファイルを現在のディレクトリではなく指定した出力ディレクトリに書き込みます。

docling convert report.pdf --to md --output ./out
フラグ、出力、ヒント

使用するフラグ

  • --output 結果を保存するディレクトリ(ファイル名ではありません)。

期待される出力

./out/report.md

バリエーション

複数の形式を一度にエクスポート

docling convert report.pdf --to md --to json --to html --output ./out

よくある間違い: --output がファイル名ではなくディレクトリを取ることを忘れる。--to と組み合わせて拡張子を選びます。

複数の形式を一度にエクスポート

OutputIntermediate

--to フラグは繰り返し可能です。1 回の実行で Markdown、JSON、HTML を生成します。

docling convert report.pdf --to md --to json --to html
フラグ、出力、ヒント

使用するフラグ

  • --to 出力形式。フラグを繰り返すと複数の形式を一度にエクスポートできます。

期待される出力

report.md  report.json  report.html

バリエーション

すべてを 1 つのフォルダに

docling convert report.pdf --to md --to json --output ./out

よくある間違い: カンマ区切りのリストを渡す(--to md,json)。代わりにフラグを繰り返します。

フォルダ全体を変換

BasicIntermediate

Docling にディレクトリを指定すると、その中の対応ドキュメントをすべて走査します。

docling convert ./inbox --output ./out
フラグ、出力、ヒント

使用するフラグ

  • --output 結果を保存するディレクトリ(ファイル名ではありません)。
  • --abort-on-error 最初のファイルが失敗した時点で実行全体を停止します。

期待される出力

Converting ./inbox/a.pdf … done
Converting ./inbox/b.docx … done

バリエーション

1 つのファイルが失敗しても続行

docling convert ./inbox --output ./out --no-abort-on-error

1 つの形式に絞り込む

docling convert ./inbox --from pdf --output ./out

よくある間違い: サブフォルダへの再帰が常に望ましいと想定する。大きな実行の前に出力されたファイル一覧を確認してください。

名前付きの複数ファイルを変換

BasicIntermediate

1 つのコマンドで複数のパスを渡します。それぞれが独立して変換されます。

docling convert a.pdf b.docx c.pptx --output ./out
フラグ、出力、ヒント

使用するフラグ

  • source Accepts one or more local paths, directories or URLs.

期待される出力

a.md  b.md  c.md  written to ./out

バリエーション

URL を含む混在ソース

docling convert a.pdf https://example.com/b.pdf --output ./out

よくある間違い: グロブ(“*.pdf”)を引用してシェルが展開すると期待する。シェルに展開させるか、ディレクトリを渡します。

すべてのモデルを事前ダウンロード

OfflineIntermediate

オフライン利用の前にレイアウトと表のモデルをローカルにキャッシュします。

docling-tools models download --all
フラグ、出力、ヒント

使用するフラグ

  • --all Download every available model (large).

期待される出力

Downloading layout model…
Downloading tableformer model…
Models cached in $HOME/.cache/docling/models

バリエーション

必要なものだけをダウンロード

docling-tools models download layout tableformer rapidocr

HuggingFace リポジトリをダウンロード

docling-tools models download-hf-repo docling-project/docling-models

よくある間違い: 従量制接続で --all をダウンロードする。使用する特定のモデルを選んでください。

DOCXをMarkdownに変換

ConversionStarter

Microsoft Word文書をMarkdownに解析します。

docling convert contract.docx --to md
フラグ、出力、ヒント

使用するフラグ

  • --to md 出力形式。フラグを繰り返すと複数の形式を一度にエクスポートできます。

期待される出力

# Service Agreement

1. Scope
2. Payment terms…

バリエーション

レガシー .doc ファイル

docling convert contract.doc --to md

よくある間違い: OCR オプションが効くと期待する。Office 形式はネイティブに解析されるため --ocr-engine は効果がありません。

PPTXをMarkdownに変換

ConversionStarter

PowerPointのスライド、テキストボックス、発表者ノートを解析します。

docling convert slides.pptx --to md
フラグ、出力、ヒント

使用するフラグ

  • --page-range 指定したページ範囲のみを変換します。PDF、XLSX、PPTX が対応します。

期待される出力

## Slide 1 — Overview

Bullet one
Bullet two

バリエーション

最初の 10 枚のスライドのみ

docling convert slides.pptx --page-range 1-10 --to md

よくある間違い: スライド内の画像が説明されると想定する。そのためには --enrich-picture-description を追加します。

XLSXをMarkdownに変換

ConversionStarter

Excelブックをシートごとの構造化テーブルに解析します。

docling convert workbook.xlsx --to md
フラグ、出力、ヒント

使用するフラグ

  • --page-range 指定したページ範囲のみを変換します。PDF、XLSX、PPTX が対応します。

期待される出力

## Sheet 1

| Region | Q1 | Q2 |
|--------|----|----|
| EMEA   | 12 | 15 |

バリエーション

ロスレス構造

docling convert workbook.xlsx --to json

よくある間違い: XLSX を PDF のように扱って OCR を有効にする。スプレッドシートには既定でビットマップページがありません。

HTMLをMarkdownに変換

ConversionStarter

ローカルのHTMLページをMarkdownに解析します。

docling convert page.html --to md
フラグ、出力、ヒント

使用するフラグ

  • --html-image-fetch HTML および EPUB 入力が参照する画像を取得します。

期待される出力

# Page title

Body text converted from HTML…

バリエーション

リモート画像もダウンロード

docling convert page.html --html-image-fetch remote --to md

よくある間違い: 画像の取得が既定でオフであることを忘れる。画像が必要な場合は --html-image-fetch を渡します。

CSV を Markdown に変換

ConversionStarter

カンマ区切りのデータを Markdown テーブルに変換します。

docling convert data.csv --to md
フラグ、出力、ヒント

使用するフラグ

  • --to md 出力形式。フラグを繰り返すと複数の形式を一度にエクスポートできます。

期待される出力

| name | score |
|------|------:|
| Ada  | 98    |

バリエーション

構造化 JSON として保持

docling convert data.csv --to json

よくある間違い: カンマ/標準 CSV 方言以外の区切り文字を使う。まず正規化してください。

EPUB を Markdown に変換

ConversionIntermediate

章構造を保ちながら電子書籍や長文 EPUB コンテンツを変換します。

docling convert book.epub --to md
フラグ、出力、ヒント

使用するフラグ

  • --html-image-fetch HTML および EPUB 入力が参照する画像を取得します。

期待される出力

# Chapter 1

Long-form text…

バリエーション

挿絵を含める

docling convert book.epub --html-image-fetch all --to md

よくある間違い: 画像を取得せず、図が欠けている理由を不思議に思う。

Markdown を HTML に変換

ConversionIntermediate

Markdown ファイルを再処理し、クリーンな HTML をエクスポートします(表とコードを保持)。

docling convert notes.md --to html
フラグ、出力、ヒント

使用するフラグ

  • --to html 出力形式。フラグを繰り返すと複数の形式を一度にエクスポートできます。

期待される出力

<h1>Notes</h1>
<p>…</p>

バリエーション

長いページを分割

docling convert notes.md --to html_split_page

よくある間違い: 画像ファイルが生成されると期待する。HTML エクスポートはボックスを参照するだけで、新しい画像を描画しません。

LaTeX を Markdown に変換

ConversionAdvanced

LaTeX ソースを解析し、オプションで TikZ 図をレンダリングします。

docling convert paper.tex --to md
フラグ、出力、ヒント

使用するフラグ

  • --tikz-engine Set to 'tectonic' to rasterize tikzpicture diagrams.

期待される出力

# Introduction

The math is preserved as LaTeX where possible…

バリエーション

TikZ 図を画像としてレンダリング

docling convert paper.tex --tikz-engine tectonic --to md

よくある間違い: Tectonic がない、または失敗すると、TikZ レンダリングは黙ってソースを保持するフォールバックをします。

単一画像を OCR

OCRIntermediate

テキストを含む PNG/JPEG/TIFF 画像を OCR で Markdown に変換します。

docling convert scan.png --to md --ocr-mode full_page
フラグ、出力、ヒント

使用するフラグ

  • --ocr-mode full_page どの文書領域を OCR エンジンに渡すか。
  • --ocr-engine OCR エンジンのプロバイダー。

期待される出力

Text recognised from the image…

バリエーション

RapidOCR を使用

docling convert scan.png --ocr-engine rapidocr --to md

よくある間違い: 低 DPI の写真で既定の OCR モードを使う。精度を上げるには解像度を高くしてください。

スキャンPDFにOCRを適用

OCRStarter

画像のみのページに全ページOCRを強制します。

docling convert scan.pdf --ocr-mode full_page --to md
フラグ、出力、ヒント

使用するフラグ

  • --ocr-mode full_page どの文書領域を OCR エンジンに渡すか。

期待される出力

Text reconstructed from the scanned page images…

バリエーション

同時にエンジンを選ぶ

docling convert scan.pdf --ocr-mode full_page --ocr-engine rapidocr --to md

よくある間違い: デジタル PDF で OCR をオンのままにすると時間を浪費する。テキスト層がない、または誤っている場合にのみ強制します。

OCRエンジンを選ぶ

OCRIntermediate

特定のエンジンでOCRを実行します(例: RapidOCR)。

docling convert scan.pdf --ocr-engine rapidocr --to md
フラグ、出力、ヒント

使用するフラグ

  • --ocr-engine OCR エンジンのプロバイダー。

期待される出力

Using OCR engine: rapidocr

バリエーション

言語を指定した Tesseract

docling convert scan.pdf --ocr-engine tesseract --ocr-lang eng --to md

macOS の Apple Vision

docling convert scan.pdf --ocr-engine ocrmac --to md

よくある間違い: インストールされていないエンジンを選ぶ。RapidOCR が最も安全なクロスプラットフォームの既定です。

指定した言語で OCR

OCRIntermediate

OCR エンジンに想定する言語を伝え、精度を大幅に向上させます。

docling convert scan.pdf --ocr-engine tesseract --ocr-lang deu,fra --to md
フラグ、出力、ヒント

使用するフラグ

  • --ocr-lang OCR 言語。エンジン固有のコード、または iso: を付けた BCP-47 タグを使用します。

期待される出力

Using OCR languages: deu, fra

バリエーション

BCP-47 経由の簡体字中国語

docling convert scan.pdf --ocr-engine rapidocr --ocr-lang iso:zh-Hans --to md

エンジンに自動検出させる

docling convert scan.pdf --ocr-lang '' --to md

よくある間違い: エンジンの慣習を混在させる。各エンジンには独自のコードがあります。正規の BCP-47 タグには iso: を付けます。

OCRを無効化(デジタルPDF)

OCRStarter

テキスト層があるPDFではOCRを省略します。

docling convert report.pdf --no-ocr --to md
フラグ、出力、ヒント

使用するフラグ

  • --no-ocr Turn OCR off; the embedded text layer is used as-is.

期待される出力

Skipping OCR (digital text layer detected)…

バリエーション

不要な表もスキップ

docling convert report.pdf --no-ocr --no-tables --to md

よくある間違い: スキャンに --no-ocr を使う。空またはほぼ空の出力になります。

レイアウト領域のみを OCR

OCRAdvanced

ページ全体ではなく検出されたレイアウト領域のみに OCR を実行します。

docling convert report.pdf --ocr-mode layout_regions --to md
フラグ、出力、ヒント

使用するフラグ

  • --ocr-mode layout_regions どの文書領域を OCR エンジンに渡すか。

期待される出力

OCR applied to detected layout regions…

バリエーション

PDF 対応の領域選択

docling convert report.pdf --ocr-mode pdf_aware_layout_regions --to md

よくある間違い: ページ全体が 1 枚の写真なのに領域モードを使う。その場合は full_page を使用します。

Tesseract のページ分割モードを設定

OCRAdvanced

ページ分割モード(0-13)で Tesseract のレイアウト解析を微調整します。

docling convert scan.pdf --ocr-engine tesseract --psm 6 --to md
フラグ、出力、ヒント

使用するフラグ

  • --psm Tesseract エンジンの Page Segmentation Mode。

期待される出力

Tesseract PSM 6 — assume a single uniform block of text.

バリエーション

1 行のテキスト

docling convert scan.pdf --ocr-engine tesseract --psm 7 --to md

よくある間違い: 無視される非 Tesseract エンジンに PSM を設定する。

より高速な表抽出

TablesIntermediate

高精度モデルの代わりに高速な表モードを使います。

docling convert report.pdf --table-mode fast --to md
フラグ、出力、ヒント

使用するフラグ

  • --table-mode 表構造モデルの精度と速度のトレードオフ。

期待される出力

Rough table grid, produced faster…

バリエーション

表を完全にスキップ

docling convert report.pdf --no-tables --to md

よくある間違い: 結合セルのある財務シートで fast を使う。精度が目に見えて低下します。

表の抽出を無効化

TablesIntermediate

本文テキストのみが必要な場合は表構造モデルをスキップします。

docling convert report.pdf --no-tables --to md
フラグ、出力、ヒント

使用するフラグ

  • --no-tables Do not run the table structure model.

期待される出力

Tables rendered as plain text flow…

バリエーション

最速のデジタルテキスト経路

docling convert report.pdf --no-ocr --no-tables --to md

よくある間違い: 表が重要なのに有効にする。表の内容が段落に崩れます。

TableFormer v2 エンジンを使用

TablesAdvanced

新しい TableFormer v2 を含む特定の表構造エンジンを選択します。

docling convert report.pdf --table-structure-engine docling_tableformer_v2 --to md
フラグ、出力、ヒント

使用するフラグ

  • --table-structure-engine 表構造エンジンを選択します。

期待される出力

Using table structure engine: docling_tableformer_v2

バリエーション

Granite vision テーブルエンジン

docling convert report.pdf --table-structure-engine granite_vision_table --to md

よくある間違い: すべてのエンジンが同梱されていると想定する。一部は追加のモデルダウンロードやプラグインが必要です。

コードと数式のエンリッチを有効化

EnrichmentIntermediate

エンリッチメントモデルでLaTeX数式とコードブロックを抽出します。

docling convert paper.pdf --enrich-code --enrich-formula --to md
フラグ、出力、ヒント

使用するフラグ

  • --enrich-code コードブロックを検出してラベル付けします。
  • --enrich-formula 数式を LaTeX として抽出します。

期待される出力

```python
def hello(): …
```

$$ E = mc^2 $$

バリエーション

数式のみ

docling convert paper.pdf --enrich-formula --to md

コードのみ

docling convert repo.pdf --enrich-code --to md

よくある間違い: コードや数式のないドキュメントで両方を有効にする。それぞれがニューラル処理を追加し、変換を遅くします。

VLM で画像を説明

EnrichmentAdvanced

図や画像の自然言語による説明を生成します。

docling convert report.pdf --enrich-picture-description --to md
フラグ、出力、ヒント

使用するフラグ

  • --enrich-picture-description 視覚モデルで画像の説明を生成します。

期待される出力

<!-- picture: a bar chart showing revenue growth from 2020 to 2026 -->

バリエーション

生成トークンを制限

docling convert report.pdf --enrich-picture-description --picture-description-max-new-tokens 256 --to md

よくある間違い: 十分な RAM/VRAM がない画像の多いドキュメントで実行する。視覚モデルを読み込みます。

画像を分類

EnrichmentAdvanced

分類モデルで画像をクラス(グラフ、図、スクリーンショット、写真など)ごとにラベル付けします。

docling convert report.pdf --enrich-picture-classes --to md
フラグ、出力、ヒント

使用するフラグ

  • --enrich-picture-classes 画像を分類します(グラフ、図、スクリーンショットなど)。

期待される出力

<!-- picture class: chart -->

バリエーション

分類と説明

docling convert report.pdf --enrich-picture-classes --enrich-picture-description --to md

よくある間違い: ピクセル単位で正確なラベルを期待する。軽量な分類器であり、完全な視覚モデルではありません。

グラフデータを表に抽出

EnrichmentAdvanced

棒、円、折れ線グラフをグラフ抽出モデルで表形式データに変換します。

docling convert report.pdf --enrich-chart-extraction --to md
フラグ、出力、ヒント

使用するフラグ

  • --enrich-chart-extraction 棒グラフ、円グラフ、折れ線グラフからデータを抽出します。

期待される出力

<!-- chart: category | value -->
<!-- 2025 | 12 -->

バリエーション

テーブル出力と組み合わせる

docling convert report.pdf --enrich-chart-extraction --to json

よくある間違い: 複雑な 3D グラフのスキャンが抽出されると期待する。棒/円/折れ線以外のグラフは対象外です。

RAG用チャンクを出力

RAGIntermediate

構造を保つHybridChunkerのチャンクを生成します。

docling convert report.pdf --to chunks --chunks-type hybrid
フラグ、出力、ヒント

使用するフラグ

  • --to chunks 出力形式。フラグを繰り返すと複数の形式を一度にエクスポートできます。
  • --chunks-type --to chunks で使用するチャンカー種別。

期待される出力

{ "text": "…", "meta": { "headings": ["Revenue"] } }

バリエーション

チャンクサイズを制限

docling convert report.pdf --to chunks --chunks-max-tokens 512

階層チャンク

docling convert report.pdf --to chunks --chunks-type hierarchical

よくある間違い: Docling の構造認識チャンカーを使わず、素朴なスプリッターで Markdown エクスポートを分割する。

チャンクサイズを設定

RAGAdvanced

チャンクあたりの最大トークン数とハイブリッドチャンキングに使うトークナイザーを制御します。

docling convert report.pdf --to chunks --chunks-max-tokens 512
フラグ、出力、ヒント

使用するフラグ

  • --chunks-max-tokens チャンクあたりの最大トークン数。
  • --chunks-tokenizer ハイブリッドチャンキングに使用するトークナイザー。

期待される出力

Chunks sized to the embedding model's token limit…

バリエーション

別の埋め込みモデルに合わせる

docling convert report.pdf --to chunks --chunks-tokenizer BAAI/bge-small-en-v1.5

よくある間違い: 埋め込みモデルが対応するより大きいチャンクサイズを設定する。切り詰められます。

VLMパイプラインで変換

VLMAdvanced

Granite DoclingモデルでVLMパイプラインを使います。

docling convert report.pdf --pipeline vlm --vlm-model granite_docling --to md
フラグ、出力、ヒント

使用するフラグ

  • --pipeline vlm PDF および画像ファイルの処理パイプライン。
  • --vlm-model --pipeline vlm で使用する VLM プリセット。

期待される出力

Markdown generated page-by-page by the vision model…

バリエーション

より小さな SmolDocling プリセット

docling convert report.pdf --pipeline vlm --vlm-model smoldocling --to md

生のモデル出力を保持

docling convert report.pdf --pipeline vlm --vlm-write-native-output

よくある間違い: VLM が常に優れていると想定する。単純なデジタル PDF では標準パイプラインの方が速く安価です。

VLM の生成長を制限

VLMAdvanced

VLM が 1 ページあたりに生成できる最大トークン数を上書きします。

docling convert report.pdf --pipeline vlm --vlm-max-new-tokens 8192 --to md
フラグ、出力、ヒント

使用するフラグ

  • --vlm-max-new-tokens VLM 生成の max_new_tokens を上書きします。

期待される出力

Long, dense pages no longer get cut off…

バリエーション

デバッグ用に生の出力を保持

docling convert report.pdf --pipeline vlm --vlm-write-native-output

よくある間違い: 非常に高密度なページで既定のままにすると、ページ出力が切り詰められることがあります。

音声・動画を文字起こし (ASR)

AudioIntermediate

WAV/MP3(および動画)をASRパイプラインで文字起こしします。

docling convert lecture.mp3 --pipeline asr --to md
フラグ、出力、ヒント

使用するフラグ

  • --pipeline asr PDF および画像ファイルの処理パイプライン。
  • --asr-model 音声・動画ファイル用の ASR モデル。

期待される出力

00:00:00 — Welcome to the show…

バリエーション

より高い精度

docling convert lecture.mp3 --pipeline asr --asr-model whisper_medium --to md

字幕出力

docling convert lecture.mp3 --pipeline asr --to vtt

よくある間違い: 重要な文字起こしに既定の whisper_tiny を使う。精度には medium/large を選んでください。

動画を字幕に文字起こし

AudioIntermediate

動画の音声を文字起こしし、タイムスタンプ付きの WebVTT 字幕をエクスポートします。

docling convert talk.mp4 --pipeline asr --to vtt
フラグ、出力、ヒント

使用するフラグ

  • --to vtt 出力形式。フラグを繰り返すと複数の形式を一度にエクスポートできます。

期待される出力

WEBVTT

00:00:00.000 --> 00:00:04.000
Hello and welcome…

バリエーション

別の ASR モデル

docling convert talk.mp4 --pipeline asr --asr-model whisper_small --to vtt

よくある間違い: OCR/表のフラグが適用されると期待する。動画は ASR パイプラインのみを使用します。

シーン変化で動画をサンプリング

AudioAdvanced

動画からフレームをサンプリングする方法を選択します。固定間隔またはシーン変化。

docling convert talk.mp4 --pipeline asr --video-sampling-mode scene
フラグ、出力、ヒント

使用するフラグ

  • --video-sampling-mode 動画フレームのサンプリング方法。
  • --video-frame-interval 固定間隔モードでのフレーム間の秒数。

期待される出力

Frames sampled at scene changes…

バリエーション

より高密度の固定サンプリング

docling convert talk.mp4 --pipeline asr --video-frame-interval 5

よくある間違い: 単一の固定カメラでシーンモードを使う。そこでは固定間隔の方が予測しやすいです。

話者分離(誰が何を言ったか)

AudioAdvanced

音声/動画の文字起こしで話者をラベル付けします(resemblyzer extra が必要)。

docling convert interview.mp4 --pipeline asr --video-diarization
フラグ、出力、ヒント

使用するフラグ

  • --video-diarization 話者分離を有効にします(resemblyzer が必要)。

期待される出力

[SPEAKER_00] …
[SPEAKER_01] …

バリエーション

話者分離を明示的に無効化

docling convert interview.mp4 --pipeline asr --no-video-diarization

よくある間違い: 話者分離には resemblyzer 依存関係のインストールが必要なことを忘れる。

画像を PNG ファイルとしてエクスポート

OutputIntermediate

図を個別の PNG ファイルとして書き出し、出力ドキュメントから参照します。

docling convert report.pdf --to md --image-export-mode referenced --output ./out
フラグ、出力、ヒント

使用するフラグ

  • --image-export-mode JSON、YAML、HTML、Markdown 出力で画像をどのようにエクスポートするか。

期待される出力

./out/report.md + ./out/report_artifacts/*.png

バリエーション

画像の位置のみをマーク

docling convert report.pdf --to md --image-export-mode placeholder

base64 として埋め込む

docling convert report.pdf --to json --image-export-mode embedded

よくある間違い: --to json で referenced を使い、隣に PNG があると期待する。アーティファクトフォルダを確認してください。

DocTags をエクスポート

OutputAdvanced

モデル入力として使われるコンパクトなトークン風 DocTags マークアップを生成します。

docling convert report.pdf --to doctags
フラグ、出力、ヒント

使用するフラグ

  • --to doctags 出力形式。フラグを繰り返すと複数の形式を一度にエクスポートできます。

期待される出力

<doctag><page_1><section_header_level_1>Annual Report</section_header_level_1>…

バリエーション

VLM ネイティブ出力付き

docling convert report.pdf --pipeline vlm --to doctags

よくある間違い: DocTags を Markdown のように扱う。モデル向けのコンパクトな内部表現です。

ページ分割 HTML をエクスポート

OutputAdvanced

ページごとに分割した HTML を生成します。ビューアーや並べたレビューに便利です。

docling convert report.pdf --to html_split_page --output ./out
フラグ、出力、ヒント

使用するフラグ

  • --to html_split_page 出力形式。フラグを繰り返すと複数の形式を一度にエクスポートできます。

期待される出力

./out/report_1.html  report_2.html …

バリエーション

単一ファイル HTML

docling convert report.pdf --to html

よくある間違い: 分割出力がページごとに 1 つ書き出すのに、単一の HTML ファイルを探す。

検出したレイアウトを可視化

OutputAdvanced

検出した要素のバウンディングボックスを出力のページ画像に重ねます。

docling convert report.pdf --show-layout --to md --output ./out
フラグ、出力、ヒント

使用するフラグ

  • --show-layout 要素のバウンディングボックスをページ画像に重ねて表示します。

期待される出力

Page images with coloured layout boxes…

バリエーション

表のセルを可視化

docling convert report.pdf --debug-visualize-tables

よくある間違い: Markdown 自体にボックスが描かれると期待する。描かれるのはエクスポートされたページ画像です。

NVIDIA GPU(CUDA)で実行

PerformanceIntermediate

CUDA で推論を高速化し、スレッド/バッチ設定を調整します。

docling convert report.pdf --device cuda --num-threads 8 --to md
フラグ、出力、ヒント

使用するフラグ

  • --device cuda モデル推論のハードウェアアクセラレーター。
  • --num-threads モデル推論に使用するスレッド数。

期待される出力

Using accelerator device: cuda

バリエーション

より大きなページバッチ

docling convert big.pdf --device cuda --page-batch-size 16

よくある間違い: CUDA ランタイムのないマシンで --device cuda を渡す。代わりに auto または cpu を使用します。

Apple Silicon(MPS)で実行

PerformanceIntermediate

M シリーズ Mac で Metal バックエンドを使い、推論を高速化します。

docling convert report.pdf --device mps --to md
フラグ、出力、ヒント

使用するフラグ

  • --device mps モデル推論のハードウェアアクセラレーター。

期待される出力

Using accelerator device: mps

バリエーション

Docling に選ばせる

docling convert report.pdf --device auto --to md

よくある間違い: MPS が専用 GPU に匹敵すると期待する。堅実な高速化であり、データセンター向けカードではありません。

ページバッチサイズを増やす

PerformanceAdvanced

1 バッチあたりのページ数を増やし、大きなドキュメントで GPU/CPU スループットを高めます。

docling convert big.pdf --page-batch-size 16 --to md
フラグ、出力、ヒント

使用するフラグ

  • --page-batch-size 1 バッチで処理するページ数。

期待される出力

Processing 16 pages per batch…

バリエーション

メモリ不足時に引き下げる

docling convert big.pdf --page-batch-size 2

よくある間違い: メモリ不足エラーが出るまで上げる。変換がクラッシュする場合は下げてください。

ドキュメントごとのタイムアウトを設定

PerformanceAdvanced

処理時間を制限し、1 つの問題ファイルからバッチを保護します。

docling convert ./inbox --document-timeout 120 --output ./out
フラグ、出力、ヒント

使用するフラグ

  • --document-timeout 各文書の処理タイムアウト。

期待される出力

Timed out after 120s — moving to the next file…

バリエーション

失敗時にバッチ全体を中止

docling convert ./inbox --abort-on-error --output ./out

よくある間違い: 巨大なドキュメントに非常に短いタイムアウトを設定し、誤った失敗を得る。

変換パイプラインをプロファイリング

PerformanceAdvanced

変換段階ごとの時間を集計し、ボトルネックを見つけます。

docling convert report.pdf --profiling --to md
フラグ、出力、ヒント

使用するフラグ

  • --profiling 各変換段階に費やした時間を集計します。
  • --save-profiling Save profiling summaries to JSON.

期待される出力

layout: 3.2s  ocr: 1.1s  tableformer: 0.9s  total: 5.4s

バリエーション

数値を JSON に保存

docling convert report.pdf --profiling --save-profiling

よくある間違い: -v をオンのままプロファイリングし、ログ時間をモデル時間と誤認する。

ページ範囲のみを変換

ConversionIntermediate

ドキュメント全体ではなく一部のページのみを解析します。

docling convert report.pdf --page-range 1-4 --to md
フラグ、出力、ヒント

使用するフラグ

  • --page-range 指定したページ範囲のみを変換します。PDF、XLSX、PPTX が対応します。

期待される出力

Converting pages 1-4 only…

バリエーション

単一ページ

docling convert report.pdf --page-range 3 --to md

よくある間違い: すべてのバックエンドが範囲を尊重すると期待する。主に PDF、XLSX、PPTX です。

パスワード保護された PDF を開く

ConversionAdvanced

パスワードを指定して暗号化 PDF を変換できるようにします。

docling convert locked.pdf --pdf-password 'secret' --to md
フラグ、出力、ヒント

使用するフラグ

  • --pdf-password 保護された PDF 文書のパスワード。

期待される出力

Decrypting and converting locked.pdf…

バリエーション

環境変数からパスワードを使用

docling convert locked.pdf --pdf-password "$PDF_PW" --to md

よくある間違い: 実際のパスワードをシェル履歴に入れる。環境変数を優先してください。

PDF バックエンドを切り替え

ConversionAdvanced

問題のある PDF に対して既定の docling-parse と pypdfium2 を選べます。

docling convert report.pdf --pdf-backend pypdfium2 --to md
フラグ、出力、ヒント

使用するフラグ

  • --pdf-backend docling_parse (default) or pypdfium2.

期待される出力

Using PDF backend: pypdfium2

バリエーション

既定のパーサー

docling convert report.pdf --pdf-backend docling_parse --to md

よくある間違い: フォントエンコーディングが壊れた PDF で既定のままにする。pypdfium2 を試してください。

カスタムモデルパスを使用

OfflineAdvanced

既定のキャッシュではなく、事前に用意したモデルディレクトリを Docling に指定します。

docling convert report.pdf --artifacts-path /opt/docling/models --to md
フラグ、出力、ヒント

使用するフラグ

  • --artifacts-path 事前ダウンロード済みモデルアーティファクトの場所。

期待される出力

Loading models from /opt/docling/models…

バリエーション

代わりに環境変数を使用

DOCLING_ARTIFACTS_PATH=/opt/docling/models docling convert report.pdf --to md

よくある間違い: 空のディレクトリを指す。Docling はダウンロードを試み、オフラインでは失敗することがあります。

完全オフライン(エアギャップ)で実行

OfflineAdvanced

接続されたホストでモデルを事前取得し、ネットワークなしで変換します。

export HF_HUB_OFFLINE=1; export DOCLING_ARTIFACTS_PATH=/opt/docling/models; docling convert report.pdf --to md
フラグ、出力、ヒント

使用するフラグ

  • DOCLING_ARTIFACTS_PATH Directory holding the pre-downloaded models.
  • HF_HUB_OFFLINE Stop HuggingFace downloads and use the local cache only.

期待される出力

Conversion completes with no outbound requests…

バリエーション

HF キャッシュディレクトリを選択

export HF_HOME=/opt/docling/hf; docling convert report.pdf --to md

よくある間違い: HF_HUB_OFFLINE=1 を忘れると、Docling がネットワーク取得を試みて停止または失敗します。

Docling Serve APIを実行

ServerIntermediate

docling-serveのHTTP APIとUIをポート5001で起動します。

docling-serve run --enable-ui
フラグ、出力、ヒント

使用するフラグ

  • --enable-ui Serve the built-in web UI alongside the API.

期待される出力

Uvicorn running on http://0.0.0.0:5001  (docs at /docs)

バリエーション

Docker で実行

docker run -p 5001:5001 -e DOCLING_SERVE_ENABLE_UI=1 quay.io/docling-project/docling-serve

よくある間違い: 認証なしでサービスを公開する。プロキシと認証を前に置いてください。

リモートサービス経由で変換

ServerAdvanced

実行中の docling-serve インスタンスに変換をオフロードします(ローカルファイル、フォルダ、URL)。

docling convert-remote report.pdf --service-url http://localhost:5001 --to md
フラグ、出力、ヒント

使用するフラグ

  • --service-url Base URL of docling-serve (or DOCLING_SERVICE_URL).
  • --api-key Optional API key (or DOCLING_SERVICE_API_KEY).

期待される出力

submitting job… polling… report.md written

バリエーション

認証済みサービス

docling convert-remote report.pdf --service-url https://docling.internal --api-key "$DOCLING_KEY" --to md

websocket の代わりにポーリングを使用

docling convert-remote report.pdf --service-url http://localhost:5001 --watcher polling --to md

よくある間違い: --device のようなローカル専用フラグを convert-remote に渡す。意図的に存在しません。

MCPサーバーを実行

MCPIntermediate

AIデスクトップクライアント向けのModel Context Protocolサーバーを起動します。

uvx --from=docling-mcp docling-mcp-server
フラグ、出力、ヒント

使用するフラグ

  • --from=docling-mcp 受け付ける入力形式を制限します。odt、ods、odp には 'odf' を使用します。

期待される出力

docling-mcp server ready (stdio)

バリエーション

AI クライアント用の JSON 構成

{"mcpServers": {"docling": {"command": "uvx", "args": ["--from=docling-mcp", "docling-mcp-server"]}}}

よくある間違い: クライアントの MCP 構成に JSON ブロックではなくコマンドを貼り付ける。

ログの冗長度を上げる

DebugIntermediate

進捗(-v)または完全なデバッグログ(-vv)を出力して変換を診断します。

docling convert report.pdf -vv --to md
フラグ、出力、ヒント

使用するフラグ

  • -v / --verbose Repeat for more detail: -v info, -vv debug.
  • -q / --quiet Silence per-file progress (warnings and errors remain).

期待される出力

DEBUG docling.pipeline… loading layout model

バリエーション

スクリプト用の静かなバッチ

docling convert ./inbox --quiet --output ./out

よくある間違い: 本番で -vv をオンのままにする。デバッグログは遅く非常に冗長です。

セル、OCR、表を可視化

DebugAdvanced

デバッグビジュアライザーは各段階が検出した内容を描画し、調整とトラブルシューティングに役立ちます。

docling convert report.pdf --debug-visualize-tables
フラグ、出力、ヒント

使用するフラグ

  • --debug-visualize-layout レイアウトクラスターを可視化します。
  • --debug-visualize-tables 表のセルを可視化します。
  • --debug-visualize-ocr OCR セルを可視化します。
  • --debug-visualize-cells Visualise PDF cells.

期待される出力

Annotated page images written next to the output…

バリエーション

OCR 検出を確認

docling convert scan.pdf --debug-visualize-ocr

レイアウトクラスターを確認

docling convert report.pdf --debug-visualize-layout

よくある間違い: 複数のビジュアライザーを同時に使い、圧倒的な数の画像を得る。

シナリオを選ぶ

文書タイプから動作するコマンドへの最短ルート。1 つコピーしてファイル名を変えるだけです。

テキスト層のないスキャン PDF

全面 OCR で内容を復元します。

docling convert scan.pdf --ocr-mode full_page --to md

デジタル PDF、最速の結果

OCR と不要な表を省略します。

docling convert report.pdf --no-ocr --to md

数式を含む研究論文

LaTeX 数式とコードブロックを抽出します。

docling convert paper.pdf --enrich-formula --enrich-code --to md

表を含む財務報告書

正確な表とロスレスな構造を保ちます。

docling convert report.pdf --table-mode accurate --to json

RAG パイプラインへの供給

埋め込みに使える構造認識チャンク。

docling convert report.pdf --to chunks --chunks-type hybrid

多言語スキャン

OCR に想定する言語を指定します。

docling convert scan.pdf --ocr-engine tesseract --ocr-lang deu,fra --to md

会議の文字起こし

より大きな Whisper モデルで音声をテキスト化します。

docling convert meeting.mp3 --pipeline asr --asr-model whisper_medium --to md

複雑な視覚レイアウト

視覚言語モデルにページを読ませます。

docling convert brochure.pdf --pipeline vlm --vlm-model granite_docling --to md

オフライン / エアギャップ実行

事前ダウンロード済みモデルをネットワークなしで使用します。

HF_HUB_OFFLINE=1 docling convert report.pdf --artifacts-path /opt/models --to md
1
ここから開始

CLI の仕組み

Docling v2 では変換は明示的なサブコマンド convert の下にあります。すべてのコマンドは同じ形です:

  • source はローカルファイル、ディレクトリ、または HTTP(S) URL です。
  • 出力は既定で隣に書き出されます — --output でフォルダを、--to で形式を選びます。
  • ヘルプが正式な情報源です。 docling convert --help はインストール済みバージョンが対応する内容を常に正確に示します。
docling convert <source> [options]
docling convert report.pdf --to md --output ./out
!多くの古いチュートリアルは docling report.pdf と書いています — これは v1 構文で、現在は動作しません。v1 からの移行を参照してください。
i併用コマンド: docling-tools models はモデルを事前ダウンロードし、docling convert-remote は実行中のサービスと通信し、docling-serve は HTTP API を公開します。
2
パイプライン

パイプラインの選択

パイプラインは最大の構造上の選択です。PDF や画像に対してどのモデルを実行するかを決めます。

docling convert report.pdf --pipeline vlm --vlm-model granite_docling --to md
パイプライン使う場面トレードオフ
standardPDF と画像の既定 — レイアウト、OCR、表。バランスが良く、実績があります。
native大きな PDF にスレッド化されたネイティブパーサーを使いたい。高速な解析。--parser-threads で調整します。
vlm単一モデルの方が得意な複雑で視覚的に豊かなレイアウト。視覚モデルを読み込みます。低速で重いです。
asr音声・動画ファイル(Whisper 系)。音声のみ。OCR/表のフラグは適用されません。
legacy以前の挙動を再現したい。新規作業には非推奨です。
i通常のデジタル PDF では standard パイプラインの方が VLM より速く安価です — まずそこから始めてください。
3
形式

入力と出力

Docling は PDF、Office ファミリー、HTML、EPUB、CSV、画像、音声/動画などを読み取ります。完全な一覧と形式ごとの注意点は対応形式リファレンスを参照してください。

--to フラグは繰り返し可能なので、1 回の実行で複数の形式を出力できます。一般的な出力:

docling convert report.pdf --to md --to json --to chunks --output ./out
形式得られるもの最適な用途
md表を含む読みやすい Markdownメモ、ドキュメント、RAG テキスト(既定)
jsonバウンディングボックス付きのロスレス DoclingDocumentカスタムパイプラインと構造
chunks構造認識チャンク埋め込みとベクトルストア
html単一の HTML ファイルWeb プレビューとメール
html_split_pageページごとに 1 つの HTML ファイルページ単位のビューアー
doctagsコンパクトなトークン風マークアップモデル入力とトークンワークフロー
yamltextvttdoclangdclxlatexシリアライズ、字幕、アーカイブ、ソース形式特定の下流ツール
i画像の扱いは --image-export-mode placeholder|embedded|referenced で制御します。
4
OCR

OCR の判断

OCR は精度と実行時間の両方で最大の要因です。意識的に有効化してください。

  • スキャン、写真、テキスト層のない PDF では OCR を有効にします。
  • デジタル PDF では OCR を無効にします(--no-ocr)— 多くの場合数倍速くなります。
  • default モードはテキストのないページのみを OCR します。full_page はすべてのページを OCR し、検出されたテキストを上書きします。
  • layout_regionspdf_aware_layout_regions は検出された領域のみを OCR します。
docling convert scan.pdf --ocr-mode full_page --to md
!スキャン PDF の出力が空ですか? --ocr-mode full_page を強制してください。フォントが壊れていても、プログラム的なテキストには OCR は実行されません。

--ocr-engine でエンジンを、--ocr-lang で言語を指定します。OCR リファレンスでエンジンを比較してください。

5
パフォーマンス

速度とハードウェア

変換コストは、どのモデルがどこで実行されるかに支配されます。

docling convert report.pdf --device cuda --num-threads 8 --to md
手段効果
--no-ocrデジタル PDF で最大の効果。
--no-tables、エンリッチメントを省略不要なニューラル処理を避けます。
--device cuda|mps|xpu推論を GPU に移します(CUDA、Apple Silicon、Intel)。
--num-threadsモデル推論の CPU 並列度(既定 4)。
--page-batch-size1 バッチあたりのページ数を増やします — メモリが厳しくなるまで上げます。
--profiling段階ごとの時間を示し、実際のボトルネックを最適化できます。
i長時間のバッチは --document-timeout 120 で保護します。エアギャップのアクセラレーターは --artifacts-path を参照してください。
6
自動化

バッチと自動化

ディレクトリを渡せば Docling が走査します。命名、並列度、増分実行を完全に制御したい場合はシェルでループします。

組み込みのフォルダ変換

Docling がディレクトリを走査します — 最も簡単なバッチ手段です。

docling convert ./inbox --output ./out
PowerShell フォルダループ

Windows でどのファイルを対象にするかを完全に制御します。

Get-ChildItem ./inbox -Recurse -Filter *.pdf | ForEach-Object { docling convert $_.FullName --to md --output ./out }
xargs による並列バッチ

大規模な一括処理で 4 件ずつ変換します(CPU/RAM に注意)。

find ./inbox -name '*.pdf' -print0 \ | xargs -0 -P 4 -I{} docling convert {} --to md --output ./out
新規ファイルのみ変換

既に出力があるファイルをスキップします。増分実行に便利です。

for f in ./inbox/*.pdf; do out="./out/$(basename "${f%.pdf}").md" [ -f "$out" ] || docling convert "$f" --to md --output ./out done
堅牢な本番バッチ

文書ごとのタイムアウトと、失敗後も継続する設定。

docling convert ./inbox --output ./out \ --document-timeout 120 \ --no-abort-on-error \ --quiet
単一形式をストリーム出力

Windows で 1 つの文書を直接ファイルに出力します。

docling convert .\report.pdf --to md | Out-File -Encoding utf8 .\report.md
!並列実行はプロセスごとに 1 つのモデルパイプラインを共有します — CPU と RAM を監視し、マシンがスワップする場合は -P--page-batch-size を下げてください。
7
RAG

RAG 用チャンク

Docling はフラットな文字列ではなく文書ツリーをチャンク化するため、見出しと表がチャンク内に保たれます。

  • --chunks-type hybrid(既定)または hierarchical
  • --chunks-max-tokens は埋め込みモデルの上限に合わせます。
  • --chunks-tokenizer はトークン数の計数に使う HuggingFace トークナイザーを選びます。
docling convert report.pdf --to chunks --chunks-type hybrid --chunks-max-tokens 512

ベクトルストアの例は RAG ガイドを参照してください。

8
オフライン

オフラインとモデル

接続されたホストでモデルを一度事前ダウンロードし、隔離されたホストでネットワークなしに変換します。

  • docling-tools models download layout tableformer rapidocr は使うものだけを取得します。
  • スクリプトではフラグの代わりに DOCLING_ARTIFACTS_PATH を設定します。
  • RapidOCR は読み取り専用ファイルシステムで問題になることがあります — そのような環境では Tesseract を推奨します。
docling-tools models download --all
HF_HUB_OFFLINE=1 docling convert report.pdf --artifacts-path /opt/docling/models --to md
9
サーバー

サーバーとリモート変換

多くのクライアントや言語が必要とする場合は変換をサービスとして実行し、リモートクライアントでオフロードします。

docling-serve run --enable-ui
docling convert-remote report.pdf --service-url http://localhost:5001 --to md
iconvert-remote--device のようなローカル専用フラグを意図的に省略します — 実行はサーバーが担います。AI クライアントについては MCP サーバーガイドを参照してください。
10
デバッグ

変換のデバッグ

出力がおかしい場合は、まずログを増やし、次に各段階が検出した内容を可視化します。

  • -v は情報ログ、-vv は完全なデバッグログ、-q はスクリプト向けの静音。
  • --debug-visualize-layout--debug-visualize-tables--debug-visualize-ocr は各段階の検出結果を描画します。
  • --show-layout はエクスポートされたページ画像にバウンディングボックスを重ねます。
  • --pdf-backend pypdfium2 は壊れたフォントエンコーディングの PDF に役立ちます。
docling convert report.pdf -vv --to md
11
移行

v1 構文からの移行

Docling v2 はコマンド体系を再編しました。チュートリアル、スクリプト、CI ジョブが古い形式を使っている場合は、この表で対応付けてください。

旧構文現在の構文理由
docling report.pdfdocling convert report.pdf --to mdv1 は直接変換していました。v2 は変換を convert サブコマンドの下に移しました。
docling report.pdf --format jsondocling convert report.pdf --to json--format は --to になりました。
docling report.pdf -o out.mddocling convert report.pdf --to md --output ./out-o/--output は出力先ファイルではなくディレクトリになりました。
--force-ocr--ocr-mode full_page--force-ocr は非推奨です。明示的な OCR モードを使用してください。
--ocr-engine tesseract_cli--ocr-engine tesseractエンジンの値は改名されました。tesserocr は C バインディングエンジンとして引き続き有効です。
--table-mode fast (no engine choice)--table-mode fast --table-structure-engine docling_tableformer_v2速度/精度モードと基盤の表エンジンを個別に選べるようになりました。
docling --pipeline vlm doc.pdfdocling convert doc.pdf --pipeline vlm --vlm-model granite_doclingパイプラインとモデルの選択は convert の下に移りました。
docling-tools models downloaddocling-tools models download --all引き続き利用可能です。--all は全モデルを事前ダウンロードし、名前のみは特定のセットを取得します。
!--output の変更に注意してください。これは出力先ファイルではなくディレクトリを指定します。拡張子は --to で選びます。
12
修正

よくある問題の早見表

症状最も可能性の高い原因と修正
スキャンからの Markdown が空またはほぼ空テキスト層がない — --ocr-mode full_page を追加します。
変換が非常に遅いデジタル PDF への OCR — --no-ocr を追加します。それ以外は GPU(--device)を使用します。
文字化け / GLYPH プレースホルダー壊れたフォントエンコーディング — --pdf-backend pypdfium2 を試します。
OCR 言語が正しくないエンジンのコードを使って --ocr-lang を設定します。
GPU が使われないPyTorch の CUDA/MPS ビルドをインストールし、--device cuda|mps を渡します。
MCP クライアントが接続できない生のコマンドではなく正確な JSON ブロックを使用します。

詳細な手順はトラブルシューティングにあります。

13
???? 13

CLI フラグ完全リファレンス

フラグ受け付ける値既定動作
--fromrepeatable textall supported受け付ける入力形式を制限します。odt、ods、odp には 'odf' を使用します。
--tomd, json, yaml, html, html_split_page, text, doctags, vtt, doclang, dclx, chunks, latexmd出力形式。フラグを繰り返すと複数の形式を一度にエクスポートできます。
--outputpath.結果を保存するディレクトリ(ファイル名ではありません)。
--image-export-modeplaceholder, embedded, referencedembeddedJSON、YAML、HTML、Markdown 出力で画像をどのようにエクスポートするか。
--html-image-fetchnone, local, remote, allnoneHTML および EPUB 入力が参照する画像を取得します。
--page-rangetext (e.g. 1-4)all pages指定したページ範囲のみを変換します。PDF、XLSX、PPTX が対応します。
--pdf-passwordtext-保護された PDF 文書のパスワード。
--pipelinelegacy, standard, native, vlm, asrstandardPDF および画像ファイルの処理パイプライン。
--vlm-modelgranite_docling, smoldocling, deepseek_ocr, granite_vision, pixtral, …granite_docling--pipeline vlm で使用する VLM プリセット。
--vlm-max-new-tokensintegermodel defaultVLM 生成の max_new_tokens を上書きします。
--vlm-write-native-outputflagfalse各ページの未解析の VLM 応答を <output>/<doc>.vlm-native/ に書き出します。
--asr-modelwhisper_tiny … whisper_large, plus _mlx and _native variantswhisper_tiny音声・動画ファイル用の ASR モデル。
--video-sampling-modefixed, scenefixed動画フレームのサンプリング方法。
--video-frame-intervalfloat (seconds)10.0固定間隔モードでのフレーム間の秒数。
--video-diarizationflagfalse話者分離を有効にします(resemblyzer が必要)。
--ocr / --no-ocrflagtrueビットマップ内容に対する OCR を有効または無効にします。
--ocr-modefull_page, layout_regions, pdf_aware_layout_regions, defaultdefaultどの文書領域を OCR エンジンに渡すか。
--ocr-engineauto, easyocr, rapidocr, tesserocr, tesseract, ocrmac, nemotron-ocr, kserve_v2_ocrautoOCR エンジンのプロバイダー。
--ocr-langcomma-separated codesengine defaultOCR 言語。エンジン固有のコード、または iso: を付けた BCP-47 タグを使用します。
--psminteger 0-13engine defaultTesseract エンジンの Page Segmentation Mode。
--tables / --no-tablesflagtrue表構造モデルを有効または無効にします。
--table-modeaccurate, fastaccurate表構造モデルの精度と速度のトレードオフ。
--table-structure-enginedocling_tableformer, docling_tableformer_v2, granite_vision_tabledocling_tableformer表構造エンジンを選択します。
--layout-enginelayout_object_detection, docling_layout_default, …layout_object_detectionレイアウト検出エンジンを選択します。
--enrich-codeflagfalseコードブロックを検出してラベル付けします。
--enrich-formulaflagfalse数式を LaTeX として抽出します。
--enrich-picture-classesflagfalse画像を分類します(グラフ、図、スクリーンショットなど)。
--enrich-picture-descriptionflagfalse視覚モデルで画像の説明を生成します。
--enrich-chart-extractionflagfalse棒グラフ、円グラフ、折れ線グラフからデータを抽出します。
--chunks-typehybrid, hierarchicalhybrid--to chunks で使用するチャンカー種別。
--chunks-max-tokensintegertokenizer limitチャンクあたりの最大トークン数。
--chunks-tokenizerHuggingFace model idsentence-transformers/all-MiniLM-L6-v2ハイブリッドチャンキングに使用するトークナイザー。
--deviceauto, cpu, cuda, mps, xpuautoモデル推論のハードウェアアクセラレーター。
--num-threadsinteger4モデル推論に使用するスレッド数。
--page-batch-sizeinteger41 バッチで処理するページ数。
--document-timeoutfloat (seconds)none各文書の処理タイムアウト。
--abort-on-errorflagfalse最初のファイルが失敗した時点で実行全体を停止します。
--profilingflagfalse各変換段階に費やした時間を集計します。
--artifacts-pathpathHF cache事前ダウンロード済みモデルアーティファクトの場所。
--enable-remote-servicesflagfalseモデルがリモートサービスに接続する場合に必要です。
--allow-external-pluginsflagfalseサードパーティのプラグインエンジンの読み込みを有効にします。
-v / --verboserepeatable0-v は情報ログ、-vv はデバッグログ。
-q / --quietflagfalseファイルごとの進捗ログを抑制します。
--show-layoutflagfalse要素のバウンディングボックスをページ画像に重ねて表示します。
--debug-visualize-layoutflagfalseレイアウトクラスターを可視化します。
--debug-visualize-tablesflagfalse表のセルを可視化します。
--debug-visualize-ocrflagfalseOCR セルを可視化します。
--versionflag-インストールされている Docling のバージョンを表示します。
14
???? 14

Docling CLI に関する質問

`docling` と `docling convert` の違いは何ですか?
Docling v1 では `docling file.pdf` を直接実行できました。v2 では変換は明示的なサブコマンド `docling convert` の下にあります。`convert` を省略した古いチュートリアルは v1 向けに書かれたもので、現行リリースでは動作しません。`docling convert file.pdf --to md` を使用してください。
スキャンした PDF が空の出力になるのはなぜですか?
スキャンした PDF にはテキスト層がないため、OCR を強制する必要があります。`docling convert scan.pdf --ocr-mode full_page` を実行してください。ページがより大きな PDF 内の画像である場合は、OCR が有効(既定で有効)であることと、OCR エンジンがインストールされていることも確認してください。
変換を速くするにはどうすればよいですか?
デジタル PDF には `--no-ocr` を追加すると(多くの場合数倍速くなります)、不要な機能(例: `--no-tables`)を省略します。GPU があれば `--device cuda` または `--device mps` を使用し、`--num-threads` と `--page-batch-size` を調整します。`--profiling` で時間が実際にどこに使われているかを確認できます。
どの OCR エンジンを選べばよいですか?
まず `auto` から始めてください。RapidOCR はクロスプラットフォームで堅実な既定値で、CPU に優しいです。多言語には `tesseract`/`tesserocr`、macOS では `ocrmac`、CUDA 環境でのみ `nemotron-ocr` を使用します。OCR ガイドでご自身の文書を用いて比較してください。
GPU は必要ですか?
いいえ。Docling は CPU で動作します。GPU は主に大きな文書での OCR とエンリッチメントモデルを高速化します。Apple Silicon では `--device mps`、NVIDIA では `--device cuda` を使用できます。
変換されたファイルはどこに書き出されますか?
既定ではコマンドを実行した場所と同じカレントディレクトリに書き出されます。ディレクトリを指定するには `--output ./some/folder` を使用します。`--output` はファイル名ではなくディレクトリである点に注意してください。
多数のファイルやフォルダ全体を変換するには?
ディレクトリを渡す(`docling convert ./inbox --output ./out`)、複数のパスを一度に渡す、または完全な制御のためにシェルループを使用します。上記の基本コマンドとバッチレシピは bash、PowerShell、並列実行をカバーしています。
RAG システム用のチャンクを取得するには?
`docling convert report.pdf --to chunks --chunks-type hybrid` を使用します。チャンクは見出しと表構造を保持します。`--chunks-max-tokens` でサイズを制限し、`--chunks-tokenizer` でトークナイザーを選択できます。
Docling を完全にオフラインで実行できますか?
はい。接続されたマシンで `docling-tools models download --all` によりモデルを事前ダウンロードし、隔離されたホストで `DOCLING_ARTIFACTS_PATH`(および `HF_HUB_OFFLINE=1`)を設定し、`--artifacts-path` でコピーしたキャッシュを指定します。
標準パイプラインではなく VLM パイプラインをいつ使うべきですか?
従来のレイアウト解析が苦手とする複雑で視覚的に豊かなページ、または単一のエンドツーエンドモデルを使いたい場合に `--pipeline vlm` を使用します。通常のデジタル PDF では標準パイプラインの方が速く安価なので、まずそちらから始めてください。
Docling は文書をアップロードしますか?
いいえ。Docling は既定で文書をローカルで処理し、テレメトリーを送信しません。リモートモデルは、`--enable-remote-services` で明示的に有効にするか、パイプラインを外部サービスに向けた場合にのみ使用されます。
`--force-ocr` はまだサポートされていますか?
非推奨です。`--ocr-mode full_page` を使用してください。これはすべてのページに OCR を適用し、既存のテキストを置き換えるサポートされた方法です。