HTML to PDF is a simple tool for converting HTML to PDF. It returns the PDF file generated from the HTML.
async function callHTMLtoPDFAPI() {
try {
const requestBody = {
"marginTop": 0.4,
"marginBottom": 0.4,
"marginLeft": 0.4,
"marginRight": 0.4,
"landscape": false,
"html": "<!doctype html> <html> <head> <title>This is the title of the webpage!</title> </head> <body> <p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p> </body> </html>"
};
const response = await fetch('https://api.apiverve.com/v1/htmltopdf', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify(requestBody)
});
const data = await response.json();
console.log(data);
} catch (error) {
console.error('Error:', error);
}
}
callHTMLtoPDFAPI();curl -X POST "https://api.apiverve.com/v1/htmltopdf" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"param": "value"
}'Get your API key: https://apiverve.com
π For more examples, see the examples folder
Choose your preferred programming language:
npm install @apiverve/htmltopdfView NPM Package β | Package Code β
dotnet add package APIVerve.API.HTMLtoPDFView NuGet Package β | Package Code β
pip install apiverve-htmltopdfView PyPI Package β | Package Code β
implementation 'com.github.apiverve:htmltopdf-api:1.0.0'β Multi-platform support - Use the same API across Node.js, .NET, Python, Android, and browsers β Simple authentication - Just add your API key in the request header β Comprehensive documentation - Full examples and API reference available β Production-ready - Used by developers worldwide
π Full API Documentation: https://docs.apiverve.com/ref/htmltopdf
Common use cases for the HTML to PDF API:
- β Integration into web applications
- β Mobile app development
- β Data analysis and reporting
- β Automation workflows
- β Microservices architecture
All requests require an API key in the header:
x-api-key: YOUR_API_KEY_HERE
Get your API key: https://apiverve.com
All responses are JSON with this structure:
{
"status": "ok",
"data": { ... }
}- π¬ Support: https://apiverve.com/contact
- π Issues: GitHub Issues
- π Documentation: https://docs.apiverve.com
- π Website: https://apiverve.com
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
For security concerns, please review our Security Policy.
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by APIVerve
Copyright Β© 2025 APIVerve. All rights reserved.