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.

Overview

ComPDF Conversion SDK supports converting PDF documents to OFD documents. Similar to Searchable PDF, OFD conversion also supports OCR, page background preservation, and transparent text layers.

Notice

  • If you need to generate searchable OFD output, enable transparent_text.
  • When enable_ocr is enabled, specify the OCR language through languages.

Sample

c
CPDF_SetDocumentAIModel(CPDF_TEXT("path/documentai.model"), -1);

COCRLanguage languages[] = {e_CENGLISH};

CConvertOption option = CPDF_DefaultConvertOption();
option.enable_ocr = true;
option.languages = languages;
option.language_count = 1;
option.contain_page_background_image = true;
option.transparent_text = true;

CPDF_StartPDFToOfd(CPDF_TEXT("scan.pdf"), CPDF_TEXT("password"), CPDF_TEXT("path/output.ofd"), option, NULL);