Skip to main content

API Reference

HTML to PDF API Documentation


Welcome to the PDFBolt API documentation

This API allows you to convert HTML content and web pages to PDF files seamlessly. Below, you will find all the necessary details to integrate the API into your application.


➡️ Introduction

PDFBolt API provides a simple and powerful way to convert HTML and web pages to PDF. This service can be integrated into your applications to generate high-quality PDFs effortlessly.


➡️ Authentication

To use the PDFBolt API, you need to provide an API key in the request headers for authorization.
  • Key: API_KEY
  • Value: Replace with your actual API key 📌

Adding the API Key in Postman
1Go to the Authorization tab.
2Select API Key as the Auth Type.
3Set the Key to API_KEY.
4Set the Value to your API key.
5Choose Header to add the key to the request headers.

➡️ Endpoints

Convert HTML/URL to PDF

Method: POST

Endpoint: https://pdfbolt-environment.onrender.com/api/conversion/pdf

Description: This endpoint converts HTML content or a web page URL into a PDF file.


➡️ Request Body Parameters

The request body should be a JSON object with the following fields:

ParameterTypeDescription
urlstringThe url of the web page to convert to PDF.
htmlstringThe html content to convert to PDF.
encodedbooleanIndicates if the HTML content is Base64 encoded. Defaults to false.
printStylesbooleanIndicates if print styles should be applied. Defaults to true.

➡️ Example Requests

Here's an example of how to use the API to convert a web page to a PDF:

📌 Using URL
{
"url": "https://example.com/",
"encoded": false,
"printStyles": true
}

📌 Using HTML Content
{
"html": "<html><body><h1>Hello, World!</h1></body></html>",
"encoded": false,
"printStyles": true
}

➡️ Response


Success Response

The response will be a binary PDF file. Ensure your client handles binary responses properly.

Status CodeDescription
200Success

Error Handling

The API might return various errors.

Status CodeDescription
400Bad Request - missing or invalid parameters
500Internal Server Error

➡️ Contact and Support

🔎 If you have any further questions or need assistance, please contact us.