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.

PDF API Reference

Reference for ComPDF Self-hosted PDF tool APIs.

PDF APIs are grouped as page editing, PDF specifications, PDF security, and advanced PDF tools. All PDF tool APIs require the x-api-key request header.

FeatureRequest URLDescription
PDF Merge API/api/v1/process/pdf/mergeMerge multiple PDF files into one PDF in upload order.
PDF Split API/api/v1/process/pdf/splitSplit a PDF into a ZIP package of result files.
PDF Extract API/api/v1/process/pdf/extractExtract selected pages from a PDF into a new PDF.
Insert PDF Pages API/api/v1/process/pdf/insert-from-pdfInsert pages from another PDF into the main PDF.
Insert Blank Pages API/api/v1/process/pdf/insert-blankInsert blank pages into a PDF.
PDF Delete Pages API/api/v1/process/pdf/deleteDelete selected pages from a PDF.
PDF Rotate Pages API/api/v1/process/pdf/rotateRotate selected pages in a PDF.
PDF Standards Conversion API/api/v1/process/pdf/pdfaConvert a PDF to a standards-compliant profile such as PDF/A, PDF/X, PDF/E, or PDF/UA as supported by the private SDK.
PDF Encryption API/api/v1/process/pdf/encryptEncrypt a PDF and optionally set permissions.
PDF Decryption API/api/v1/process/pdf/decryptDecrypt a password-protected PDF.
Add Watermark API/api/v1/process/pdf/watermark/addAdd a text or image watermark to a PDF.
Remove Watermark API/api/v1/process/pdf/watermark/removeRemove watermarks from a PDF.
PDF Compression API/api/v1/process/pdf/compressCompress and optimize a PDF.

Common Rules

ItemDescription
AuthenticationRequest header: x-api-key: your_api_key_here.
Content typemultipart/form-data.
Request objectrequest is a JSON string. If omitted, the ComPDF Self-hosted forwards remaining non-file fields.
ResultSuccessful requests return a file stream directly.

Request Example

bash
curl -X POST "http://localhost:8080/api/v1/process/pdf/merge" \
  -H "x-api-key: your_api_key_here" \
  -F "files=@/path/to/a.pdf" \
  -F "files=@/path/to/b.pdf" \
  -F 'request={"outputFileName":"merged.pdf"}'