Documentation

Html2pdf API is a powerful API that allows you to convert HTML to PDF or PNG Screenshots in seconds. It is perfect for generating invoices, reports, and other documents from your web application. With Html2pdf API, you can easily convert any HTML content to a high-quality PDF or PNG image that you can download or save to your S3 bucket.

S3 bucket integration is optional and allows you to store the generated files directly in your S3 bucket. This feature is perfect for managing large volumes of documents and automating your document generation process. If do not have an S3 bucket, we will store the files for you for 7 days. After that, they will be automatically deleted.

Getting Started

Setting up the API is easy. Just create an account on the Html2pdf API website and generate one or more API keys. You can use these keys to authenticate your requests to the API and start converting HTML to PDF or PNG.

Each request to the API must include your API key in the headers.

headers: {
    Authorization: Bearer <API_KEY>
}

You can decide to wait for the conversion to finish or query the status of the conversion later. In the Business plan and Enterprise plan you can also set a webhook to receive a notification when the conversion is finished.

To query the status of the conversion, you can use the GET: /api/generation/:id endpoint.
This endpoint requires the id of the conversion and it will return the information about the conversion.
The status field will tell you if the conversion is still in progress or if it has finished. The available status values are <queue|processing|completed>.

Roadmap

We are working hard to bring you new features and improvements. A clear roadmap has yet to be defined, because we are in the early stages of development and we are listening to our customers to understand what they need.
If you have any idea or suggestion, please let us know by sending a message to our support team.