Convert HTML to PDF Online

Powerful and simple API to transform your HTML into professional PDFs. No installation required.

HTML to PDF Features

Everything you need to convert HTML to PDF

🚀

Instant Conversion

Convert HTML to PDF in seconds

⚙️

Developer API

Easy integration into your applications

🎨

Customizable Templates

Create reusable templates

💅

CSS layouts

CSS styles and print rules for your documents

📜

JSON template data

Populate variables and loops with your JSON data

✨

High Quality

Professional high-resolution PDFs

As Simple as 1, 2, 3

javascript
const response = await fetch('https://api.templatr.app/pdf/TEMPLATE_ID?format=pdf', {
  method: 'POST',
  headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({
  "customer": {
    "name": "Ada"
  },
  "items": [
    {
      "description": "Design",
      "price": 120
    }
  ],
  "total": 120
})
});
if (!response.ok) throw new Error(await response.text());
const pdf = await response.blob();

Prepare your HTML for print

Use a layout that fits the paper width. Define styles in the template, control page breaks and test tables with multiple rows. Variables and loops fill the document from your JSON object.

Template scripts are not executed. Prepare the data and HTML before conversion. Use embedded images for logos and illustrations; external resources may be blocked by the renderer’s security rules.

Check the output with long text, empty fields and multiple pages. Once the layout works, save the template and reuse it from your application.

Compare PDF generation approaches

Start Converting HTML to PDF Today

Free trial. No credit card required.

Create Free Account