> For the complete documentation index, see [llms.txt](https://docs.locoia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.locoia.com/connectors/helpers/pdf-creator-helper.md).

# PDF Helper

Create PDFs from HTML with CSS

<figure><img src="https://291121471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McrRFZHYH27bqKzOVDd%2Fuploads%2FxbtuqdWnMaJy0C3ZWEpX%2Fimage.png?alt=media&amp;token=f86729a3-5caa-4444-b472-47381e4cd5cc" alt="" width="150"><figcaption></figcaption></figure>

## 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.

```markup
<!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>
```

{% hint style="info" %}
You need to follow the above template in order to ensure **UTF-8 encoding**.
{% endhint %}

<figure><img src="https://291121471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McrRFZHYH27bqKzOVDd%2Fuploads%2FlkJIUE2c0NzRtbjFvsG1%2Fimage.png?alt=media&amp;token=c1495a96-753d-430b-aa95-b487114c06ad" alt=""><figcaption></figcaption></figure>

## Page Sizes

If you like to change the paper size you can add

<pre class="language-html"><code class="lang-html"><strong>&#x3C;meta name="pdfkit-page-size" content="LETTER"/>
</strong></code></pre>

or

<pre class="language-html"><code class="lang-html"><strong>&#x3C;meta name="pdfkit-page-size" content="A4"/>
</strong></code></pre>

to your HTML header.

A list of paper sizes can be found [here](https://pdfkit.org/docs/paper_sizes.html).

## Landscape Orientation

If you like to receive a document in landscape orientation, you can add the following to your HTML header:

```html
<meta name="pdfkit-orientation" content="Landscape"/>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.locoia.com/connectors/helpers/pdf-creator-helper.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
