Skip to content
ComPDF
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.

Conversion Options

Reference for the options JSON field used by conversion APIs.

These parameters are based on the current ComPDF Web and ComPDF Self-hosted API behavior. Feature pages list the common fields for that feature; this page lists shared fields that can be passed in the options JSON object.

ParameterTypePurpose
enableAiLayoutInteger or StringWhether to enable AI layout analysis. 0 = disabled, 1 = enabled. The ComPDF Web default is 1.
pageLayoutModeStringLayout reconstruction mode. e_Flow favors editable flowing text, while e_Box favors fixed visual placement.
isContainImgInteger or StringWhether to include images in the output. 0 = no, 1 = yes.
isContainAnnotInteger or StringWhether to include annotations in the output. 0 = no, 1 = yes.
formulaToImageInteger or StringWhether to render formulas as images. 0 keeps formulas as editable content where possible; 1 renders formulas as images.
enableOcrInteger or StringWhether to use OCR. 0 = disabled, 1 = enabled.
ocrRecognitionLangStringOCR language code. Supported values: AUTO, CHINESE, CHINESE_TRAD, ENGLISH, KOREAN, JAPANESE, LATIN, DEVANAGARI, CYRILLIC, ARABIC, TAMIL, TELUGU, KANNADA, THAI, GREEK, ESLAV. Default: AUTO.
ocrOptionStringINVALID_CHARACTER, SCAN_PAGE, INVALID_CHARACTERAND_SCAN_PAGE, or ALL. Default: ALL.
pageRangesStringPage ranges to process, starting from page 1. Examples: 1, 1-3, 1,3-5. Empty means all pages.
isOutputDocumentPerPageInteger or StringWhether to output each page as a separate document. 0 = no, 1 = yes.
containPageBackgroundImageInteger or StringWhether to include page background images. Mainly used with OCR-enabled conversion.
excelAllContentInteger or StringPDF to Excel option. Whether to export all content. 0 = table-oriented output, 1 = all content.
excelWorksheetOptionStringe_ForTable, e_ForPage, or e_ForDocument. Controls how worksheets are organized.
htmlOptionStringe_SinglePage, e_SinglePageWithBookmark, e_MultiPage, or e_MultiPageWithBookmark.
typeString or IntegerPDF to JSON content scope used by the ComPDF Web. 0 = text, 1 = table, 2 = all.
imageFormatStringImage output format. Supported values include JPG, JPEG, JPEG2000, PNG, BMP, TIFF, TGA, GIF, WEBP. The ComPDF Self-hosted uppercases this value before forwarding.
imageScalingNumberImage scaling ratio for PDF to image. The ComPDF Web calculates this from DPI as DPI / 72.
transparentTextInteger or StringSearchable/editable PDF option. Whether OCR text is transparent over the original page image.
sourceTypeString or IntegerSource type flag for non-PDF to PDF conversion. The ComPDF Web sends 1.
outputFileNameStringOptional output filename. When present, it is used as the preferred download filename.

Request Example

bash
curl -X POST "http://localhost:8080/api/v1/process/pdf/xlsx" \
  -H "x-api-key: your_api_key_here" \
  -F "file=@/path/to/sample.pdf" \
  -F 'options={"enableAiLayout":"1","excelWorksheetOption":"e_ForTable","ocrRecognitionLang":"AUTO"}'