Documents
How can I use granite-docling to process all PDFs in a directory and output doctags?
How can I use granite-docling to process all PDFs in a directory and output doctags?
Type
Answer
Status
Published
Created
Nov 19, 2025
Updated
Nov 19, 2025
Created by
Dosu Bot
Updated by
Dosu Bot

You can process all PDFs in a directory and output doctags using the docling CLI with the following command:

docling convert /path/to/your/pdf_directory --from pdf --to doctags --vlm-model GRANITEDOCLING --output /path/to/output_dir

This command will recursively process all PDFs in the specified directory and save .doctags files for each document in the output directory. The CLI handles batch processing and output automatically. For programmatic use, you can utilize the DocumentConverter class and its convert_all method, then call export_to_doctags() on each result. More details and example code are available in this discussion. Make sure to use the latest Granite Docling model to avoid known issues.

How can I use granite-docling to process all PDFs in a directory and output doctags? | Dosu