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.
| Parameter | Type | Purpose |
|---|---|---|
enableAiLayout | Integer or String | Whether to enable AI layout analysis. 0 = disabled, 1 = enabled. The ComPDF Web default is 1. |
pageLayoutMode | String | Layout reconstruction mode. e_Flow favors editable flowing text, while e_Box favors fixed visual placement. |
isContainImg | Integer or String | Whether to include images in the output. 0 = no, 1 = yes. |
isContainAnnot | Integer or String | Whether to include annotations in the output. 0 = no, 1 = yes. |
formulaToImage | Integer or String | Whether to render formulas as images. 0 keeps formulas as editable content where possible; 1 renders formulas as images. |
enableOcr | Integer or String | Whether to use OCR. 0 = disabled, 1 = enabled. |
ocrRecognitionLang | String | OCR language code. Supported values: AUTO, CHINESE, CHINESE_TRAD, ENGLISH, KOREAN, JAPANESE, LATIN, DEVANAGARI, CYRILLIC, ARABIC, TAMIL, TELUGU, KANNADA, THAI, GREEK, ESLAV. Default: AUTO. |
ocrOption | String | INVALID_CHARACTER, SCAN_PAGE, INVALID_CHARACTERAND_SCAN_PAGE, or ALL. Default: ALL. |
pageRanges | String | Page ranges to process, starting from page 1. Examples: 1, 1-3, 1,3-5. Empty means all pages. |
isOutputDocumentPerPage | Integer or String | Whether to output each page as a separate document. 0 = no, 1 = yes. |
containPageBackgroundImage | Integer or String | Whether to include page background images. Mainly used with OCR-enabled conversion. |
excelAllContent | Integer or String | PDF to Excel option. Whether to export all content. 0 = table-oriented output, 1 = all content. |
excelWorksheetOption | String | e_ForTable, e_ForPage, or e_ForDocument. Controls how worksheets are organized. |
htmlOption | String | e_SinglePage, e_SinglePageWithBookmark, e_MultiPage, or e_MultiPageWithBookmark. |
type | String or Integer | PDF to JSON content scope used by the ComPDF Web. 0 = text, 1 = table, 2 = all. |
imageFormat | String | Image output format. Supported values include JPG, JPEG, JPEG2000, PNG, BMP, TIFF, TGA, GIF, WEBP. The ComPDF Self-hosted uppercases this value before forwarding. |
imageScaling | Number | Image scaling ratio for PDF to image. The ComPDF Web calculates this from DPI as DPI / 72. |
transparentText | Integer or String | Searchable/editable PDF option. Whether OCR text is transparent over the original page image. |
sourceType | String or Integer | Source type flag for non-PDF to PDF conversion. The ComPDF Web sends 1. |
outputFileName | String | Optional 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"}'1
2
3
4
2
3
4