Synchronous vs. asynchronous processing
By default, your HTML document is converted to a PDF immediately, and the generated PDF is returned as the response body of your API request. This is called “synchronous” processing.
Depending on the complexity of the document, generating the PDF can take some time. Make sure to set the HTTP timeout for your API calls high enough to not prematurely abort the request. However, if the PDF has not been completed after 60 seconds, processing is aborted, and the API responds with an error.
Alternatively, you can use async=true
when calling the API to generate the PDF asynchronously. In this case, the API will immediately return a status_id
. You can use this ID to check the status of your PDF. If the PDF has been created successfully, the API provides you with a download_url
which you can use to retrieve the document.
If you additionally provide a callback_url
in the initial API request, we will make a POST
request to this URL as soon as the PDF is ready. This request will also contain the download_url
for the PDF. If the request is not successful, we will retry it up to 3 times, with increasing pauses in between.
Note that downloading the document is only possible for a limited amount of time, depending on the current retention period.
The generation time for asynchronously generated PDFs is limited to 10 minutes.