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.
| Feature | Request URL | Description |
|---|---|---|
| PDF Merge API | /api/v1/process/pdf/merge | Merge multiple PDF files into one PDF in upload order. |
| PDF Split API | /api/v1/process/pdf/split | Split a PDF into a ZIP package of result files. |
| PDF Extract API | /api/v1/process/pdf/extract | Extract selected pages from a PDF into a new PDF. |
| Insert PDF Pages API | /api/v1/process/pdf/insert-from-pdf | Insert pages from another PDF into the main PDF. |
| Insert Blank Pages API | /api/v1/process/pdf/insert-blank | Insert blank pages into a PDF. |
| PDF Delete Pages API | /api/v1/process/pdf/delete | Delete selected pages from a PDF. |
| PDF Rotate Pages API | /api/v1/process/pdf/rotate | Rotate selected pages in a PDF. |
| PDF Standards Conversion API | /api/v1/process/pdf/pdfa | Convert 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/encrypt | Encrypt a PDF and optionally set permissions. |
| PDF Decryption API | /api/v1/process/pdf/decrypt | Decrypt a password-protected PDF. |
| Add Watermark API | /api/v1/process/pdf/watermark/add | Add a text or image watermark to a PDF. |
| Remove Watermark API | /api/v1/process/pdf/watermark/remove | Remove watermarks from a PDF. |
| PDF Compression API | /api/v1/process/pdf/compress | Compress and optimize a PDF. |
Common Rules
| Item | Description |
|---|---|
| Authentication | Request header: x-api-key: your_api_key_here. |
| Content type | multipart/form-data. |
| Request object | request is a JSON string. If omitted, the ComPDF Self-hosted forwards remaining non-file fields. |
| Result | Successful 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"}'