Skip to content

PDF 转 OFD

概述

ComPDF Conversion SDK 提供了 PDF 转 OFD 的能力,可将 PDF 文档转换为 OFD 文档。与可搜索 PDF 类似,OFD 转换也支持 OCR、页面背景保留、透明文本层等选项。

注意事项

  • 若需要生成可搜索 OFD,可开启 transparent_text
  • 当同时开启 enable_ocr 时,建议通过 languages 指定本次任务的 OCR 语言。

示例

c++
LibraryManager::SetDocumentAIModel("path/documentai_v4.model");

ConvertOptions opt;
opt.enable_ocr = true;
opt.languages = {OCRLanguage::e_Chinese};
opt.contain_page_background_image = true;
opt.transparent_text = true;
CPDFConversion::StartPDFToOfd("scan.pdf", "password", "path/output.ofd", opt);