Appearance
Render PDF synchronously
A sync render request returns a document URL once the render is finished, instead of returning the raw document directly. In this case, the output is a PDF. You can also add an optional body parameter if you want Doppio to upload the rendered file to your own S3 bucket.
Route
Method: POST
Route: api.doppio.sh/v1/render/pdf/sync
Examples
Request
json
{
"page": {
"goto": {
"url": "https://www.spacejam.com/1996"
},
"pdf": {
"printBackground": true,
"format": "A4"
}
}
}Upload to your own S3 bucket (optional)
Add a doppio.presignedUrl field to upload the rendered PDF directly to your own S3-compatible bucket instead of Doppio's temporary storage (see Upload to your S3 bucket):
json
{
"doppio": {
"presignedUrl": "https://your-bucket.s3.amazonaws.com/output.pdf?X-Amz-Signature=..."
},
"page": {
"goto": {
"url": "https://www.spacejam.com/1996"
},
"pdf": {
"printBackground": true,
"format": "A4"
}
}
}Response
json
{
"doppioRequestId": "doppioreq_640d0598-0413-4385-8e4a-0ee43d531609",
"renderStatus": "SUCCESS",
"documentUrl": "https://tmp.doppio.sh/doppioreq_640d0598-0413-4385-8e4a-0ee43d531609-1661856673637.pdf",
"isAsync": false,
"isCustomBucket": false
}Body
Response
For the full list of possible response codes, see What to expect from us.
If the request succeeds, Doppio responds with the following payload:
| Property name | Type | Description |
|---|---|---|
doppioRequestId | string | Unique identifier for the request. |
renderStatus | string | Rendering status for your document. Either SUCCESS or ERROR. |
documentUrl | string | URL where you can access the rendered document. |
isAsync | boolean | Whether the request is asynchronous. For this render method, the value is always false. |
isCustomBucket | boolean | Whether the document is stored in your own S3 bucket or temporarily in ours. |