Convert HTML to PDF in seconds. Simple, Secure and Scalable
Convert your HTML or web pages into high-quality PDFs effortlessly. Our HTML to PDF API is designed for developers and businesses who need accurate, reliable, and scalable PDF generation. It delivers pixel-perfect rendering, supports fillable form fields, and handles complex layouts with ease.
Main Features
Advanced Rendering Engine
Powered by Google Chrome
The API uses the latest Chrome rendering engine to generate PDFs that look exactly as they do in the browser, ensuring pixel-perfect accuracy with full CSS and JavaScript support.
Responsive Page Support
Easily convert responsive designs into PDFs that adapt beautifully across mobile, tablet, and desktop layouts. Your content will maintain its layout and readability on every device.
Framework-Friendly
Seamlessly render pages built with your favorite front-end frameworks and tools such as React, Angular, Tailwind, Vue.js, and more. No additional setup is required.
Create Fillable PDFs
Add Interactivity and Collect User Data from Your PDFs
Transform HTML inputs into PDF fields
Convert standard HTML input elements directly into interactive PDF fields without any additional configuration.
Support for all the common field types
Create fully interactive PDFs with text fields, date fields, dropdowns, radio buttons, checkboxes, multi-select lists, text areas, and digital signature fields.
Customize appearance and behavior
Adjust the look and feel of each field by defining background colors, borders, and font sizes. Control field behavior with standard validations, prefilled values, and more.
Combine with Other Endpoints
Use it alongside other endpoints such as Flatten PDF or Extract Data to create a complete workflow for collecting, processing, and securing PDF form data.
Additional Customizations
Fine-Tune Every Detail
Control page margins, headers, and footers to achieve the perfect layout for your PDFs.
Flexible Page Options
Generate PDFs using standard paper sizes or define custom page width and height. Select specific page ranges to include only the content you need.
Enhanced Rendering Control
Enable lazy loading for images, inject custom JavaScript or CSS scripts, and set page delays to ensure complete content rendering.
Advanced Interactions
Wait for specific elements to appear or trigger clicks before capturing the page, giving you full control over dynamic and interactive content.
Quick Start
Get up and running in minutes with a simple API call. Our HTML to PDF API is designed for effortless integration into your existing workflows, whether you use Node.js, Python, PHP, or any other language. Use the examples to start converting your HTML into high-quality PDFs instantly.
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
--request POST \
--data '{"pageSizeType":"a4","url":"https://en.wikipedia.org/wiki/PDF"}' \
https://api.pdfgate.com/v1/generate/pdf \
-o output.pdfReady-to-Use Templates
Jump-start your project with our free HTML to PDF templates. Our GitHub repository includes two customizable invoice templates and one receipt template, all fully compatible with the HTML to PDF API. Clone the repo, modify the design, and instantly start generating professional invoices and receipts.
Explore the code →Full API Parameter List
Html
Url
Json Response
Page Size Type
Page Ranges
Width
Height
Orientation
Scale
Header
Footer
Margin
Timeout
Delay
Load Images
Javascript
Css
Emulate Media Type
Wait For Selector
Click Selector
Click Selector Chain Setup
Wait For Network Idle
User Agent
Http Headers
Enable Form Fields
Pre Signed Url Expires In
Metadata
Frequently Asked Questions
What is an HTML to PDF converter?
It is a tool or an online service that can transform web content (HTML, CSS) into a PDF file. It is used by software teams to generate reports, invoices, or other documents because of its simplicity.
Can I add a watermark or protect PDFs with a password?
Yes. Our API includes dedicated endpoints for PDF watermarking and encryption. After generating a PDF from HTML, you can apply password protection and/or a watermark using the appropriate endpoints.
Can I schedule batch HTML to PDF conversions?
Yes, batch conversions are supported. Be sure to manage concurrency according to the limits defined in your plan.
Do you have SDKs or client libraries for different programming languages?
We do not currently offer SDKs. However, our API is easy to use with any language, and it is well documented. Our official SDKs are coming soon to make your integration even easier.


