Locoia
Ask or search…
K
Links

PDF Helper

Create PDFs from HTML with CSS

Overview

Using the PDF Helper, you can easily create PDF documents from HTML and CSS content.

Actions

The PDF Helper has only one default action - Convert HTML To PDF.
Simply include your HTML CSS code in the input field, including any kind of variables and the helper renders DIN-A4 PDF pages. If the content exceeds a regular DIN-A4 page, it is easy to create multiple pages.
All variables can be used in regular Jinja2 syntax e.g.
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
</head>
<body>
<p>First Name: {{ zendeskContact.first_name }}</p>
</body>
</html>
You need to follow the above template in order to ensure UTF-8 encoding.

Page Sizes

If you like to change the paper size you can add
<meta name="pdfkit-page-size" content="LETTER"/>
or
<meta name="pdfkit-page-size" content="A4"/>
to your HTML header.
A list of paper sizes can be found here.

Landscape Orientation

If you like to receive a document in landscape orientation, you can add the following to your HTML header:
<meta name="pdfkit-orientation" content="Landscape"/>