API Documentation

Home

Welcome to the API documentation. Below, you'll find details on how to use the `/htmltopdf` endpoint.

Endpoint: /htmltopdf

The `/htmltopdf` endpoint requires a JSON body with the following structure:

Single Page Example

{ "pages": "base64_encode(<html><body>...</body></html>)", "globalOptions": "global options string" }

Multiple Pages Example

{ "pages": [ { "page": "base64_encode(html content)", "pageOptions": "page specific options" }, { "page": "base64_encode(url string)", "pageOptions": "page specific options" } ], "globalOptions": "global options string" }

Additional Parameters

Displaying the PDF

If you want to directly display the PDF in a browser, you can use an iframe with the following format:

<iframe src="data:application/pdf;base64,{content received from response}"></iframe>
Note: Ensure that the content received from the response is properly base64-encoded before embedding it in the iframe.