PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
ComPDF API offers three request modes for different business scenarios: synchronous, asynchronous, and pre-signed URL. This page compares them side by side and provides the full calling flow for each one to help you choose the best integration approach.
| Dimension | Synchronous (Sync) | Asynchronous (Async) | Pre-signed URL (Pre-signed) |
|---|---|---|---|
| Upload method | Direct upload: send the file to ComPDF in one multipart/form-data request | Direct upload: send the file to ComPDF in one multipart/form-data request | The client uploads directly to object storage through a pre-signed URL, and the file does not pass through the business API |
| File count | Single file (except merge endpoints) | Single / multiple files | Single / multiple files |
| Blocking | Yes. The server returns only after processing finishes | No. Returns taskId immediately | No. Returns taskId and the upload address immediately |
| How to get results | The sync response returns downloadUrl directly | Poll task status / receive Webhook notifications | Poll task status / receive Webhook notifications |
| Recommended file size | Small files up to 10 MB | 10 MB ~ 50 MB | Large files / batch jobs / browser uploads |
| Server bandwidth usage | High (both directions go through the business gateway) | High (upload still goes through the business gateway) | Low (upload goes through object storage CDN) |
| Implementation complexity | ★ Easiest | ★★ Moderate | ★★★ Slightly more complex (one extra signature step) |
| Typical scenarios | Demos, small tools, instant-feedback pages | Background batch jobs, async pipelines | Browser/mobile uploads, very large files, cross-region uploads |
Selection advice
Pros
Cons
Pros
taskId immediately, so the caller is non-blocking.Cons
Pros
Cons
Key points
Key points
taskId immediately after upload, so the caller is not blocked.Key points
x-api-key is required.200 means your HTTP request succeeded, not that file processing succeeded; use the code field in the response body as the business result.https://api-server.compdf.com/ with https://api-server.compdf.cn/ in all request URLs.