Image to PDF API reference
Base URL: https://api.justapi.tech. This API is in beta: the request shape may still change before general
availability, and the changelog will say so.
| Method | Path | Description | Modes |
|---|---|---|---|
POST |
/v1/pdf/from-images |
Combine images into a PDF | sync (sync: 58 s per call) |
Request
Send sources: a list of files in order, each with exactly one of url, base64 or file_id.
{
"sources": [
{
"url": "https://files.example.com/receipt-1.jpg"
},
{
"url": "https://files.example.com/receipt-2.jpg"
}
],
"options": {
"page_size": "letter",
"margin": 18
}
}
Options
| Option | Type | Default |
|---|---|---|
page_size |
"a4", "letter", "legal", "a3", "a5" or "fit" | "a4" |
orientation |
"auto", "portrait" or "landscape" | "auto" |
margin |
points, 0 to 144 | 0 |
output |
"url" or "base64" |
"url"; base64 only for results up to 15 MB |
Response
{
"job_id": "job_...",
"status": "completed",
"result": { "url": "https://...", "expires_at": "...", "file_id": "file_...", "bytes": 48213, "content_type": "...", "filename": "..." },
"stats": { "input_bytes": 51200, "output_bytes": 48213, "duration_ms": 640 },
"billing": { "charged_micros": 6000, "balance_micros": 4950000 }
}
Billing and failures
$0.006 per call at the first volume tier, whatever the file size. The call is synchronous and all or nothing: an unreadable source, an encrypted PDF, a bad option or a worker failure stores nothing and charges $0.00. See pricing for the volume tiers.
Example
curl https://api.justapi.tech/v1/pdf/from-images \
-H "Authorization: Bearer ak_live_..." \
-H "Content-Type: application/json" \
-d '{"sources":[{"url":"https://files.example.com/receipt-1.jpg"},{"url":"https://files.example.com/receipt-2.jpg"}],"options":{"page_size":"letter","margin":18}}'
The envelope, error catalog and billing rule are the same across every JustAPI service: see the API reference index and error codes.