How render PNG instead of PDF
Sometimes, you want to share a report on slack or through whatsapp, so you'd prefer to generate a PNG report instead of PDF. Here's how to do it!
How to do it
To generate the same layout but as a .PNG instead of a .PDF file, you can use the same endpoints /v1/pdf/sync
and /v1/pdf/async
, but passing an extra parameter convertToImage:true
on the body payload.
If you want to generate the image synchronously, you can use this guide:
Synchronous requestOr if you want to generate the image asynchronously, you can use this guide:
Asynchronous requestHere's a request example for a synchronous render:
curl --location 'https://api.pdforge.com/v1/pdf/sync' \
--header 'Authorization: Bearer pdforge_api_123456789' \
--header 'Content-Type: application/json' \
--data '{
"templateId": "check",
"convertToImage": true,
"data":{
"currentDDate": "01/12/2025",
"user": {
"name":"John Doe",
"email": "[email protected]"
},
"details": [{"score":"100", "description":"high score"}]
}
}
'
The result will be the same signedUrl described on the guides, but with a .PNG file instead.
Last updated