Skip to content
ComPDF
DemoAPI ReferenceFAQ

PDF Generation Template Editor

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

View on GitHub

Parameter Setting

Current APIs use multipart/form-data for file processing. Parameters are sent either as normal form fields or as JSON strings.

PDF Tool Parameters

PDF tool APIs use a request JSON string.

bash
curl -X POST "http://localhost:8080/api/v1/process/pdf/compress" \
  -H "x-api-key: your_api_key_here" \
  -F "[email protected]" \
  -F 'request={"quality":"medium"}'

Conversion Parameters

Conversion APIs use an options JSON string.

bash
curl -X POST "http://localhost:8080/api/v1/process/pdf/docx" \
  -H "x-api-key: your_api_key_here" \
  -F "[email protected]" \
  -F 'options={"enableAiLayout":1,"pageLayoutMode":"e_Flow","pageRanges":""}'

Async Task Parameters

Async task creation uses kind, op, uploaded files, and optional request or options.

bash
curl -X POST "http://localhost:8080/api/v1/task" \
  -H "x-api-key: your_api_key_here" \
  -F "[email protected]" \
  -F "kind=conversion" \
  -F "op=convert" \
  -F "target=docx" \
  -F 'options={"enableAiLayout":1}'

See the conversion and PDF API pages for feature-specific option fields.