Skip to content
ComPDF
DemoFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

Convert PDF to OFD

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, you can enable transparentText.
  • When enableOcr is enabled, it is recommended to specify the OCR language through languages.

Sample

php
use ComPDFKit\Conversion\OcrLanguage;

$option = new ConvertOption();
$option->enableOcr = true;
$option->languages = [OcrLanguage::ENGLISH];
$option->containPageBackgroundImage = true;
$option->transparentText = true;

Conversion::convert('Ofd', 'scan.pdf', 'password', 'output.ofd', $option);