API Reference
HTML to PDF 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
- Key:
API_KEY
- Value: Replace with your actual API key 📌
Adding the API Key in Postman | |
---|---|
1 | Go to the Authorization tab. |
2 | Select API Key as the Auth Type. |
3 | Set the Key to API_KEY . |
4 | Set the Value to your API key. |
5 | Choose 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:
Parameter | Type | Description |
---|---|---|
url | string | The url of the web page to convert to PDF. |
html | string | The html content to convert to PDF. |
encoded | boolean | Indicates if the HTML content is Base64 encoded. Defaults to false . |
printStyles | boolean | Indicates 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:
{
"url": "https://example.com/",
"encoded": false,
"printStyles": true
}
{
"html": "<html><body><h1>Hello, World!</h1></body></html>",
"encoded": false,
"printStyles": true
}
➡️ Response
The response will be a binary PDF file. Ensure your client handles binary responses properly.
Status Code | Description | |
---|---|---|
✅ | 200 | Success |
The API might return various errors.
Status Code | Description | |
---|---|---|
❌ | 400 | Bad Request - missing or invalid parameters |
❌ | 500 | Internal Server Error |
➡️ Contact and Support
🔎 If you have any further questions or need assistance, please contact us.