Skip to content
ComPDF
DemoFAQ
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

Set DocumentAI Model

Overview

Before using OCR, Layout Analysis, Table Recognition you need to set the DocumentAI model path first.

setAIModel supports an optional gpu_id parameter used to specify the GPU device index for the AI model. When gpu_id is -1, GPU acceleration is disabled.

Set AI Model Instance Count

If you need to control the number of Layout Analysis and Table Recognition model instances, call the corresponding interface to set the model instance counts.

Sample

kotlin
ConverterManager.setAIModel("<model_path>")