> For the complete documentation index, see [llms.txt](https://kb.craftformswp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.craftformswp.com/documentation/pdf-templates/create-pdf-template.md).

# Create PDF Template

CraftForms lets you design PDF documents — invoices, shipping labels, event tickets, and more — visually, using the same WordPress block editor you already know from Email Templates. Build the layout once, then generate a polished PDF automatically whenever a form is submitted, a WooCommerce order status changes (premium), or you attach it manually.

#### Step 1: Create a New PDF Template <a href="#step-1-create-a-new-pdf-template" id="step-1-create-a-new-pdf-template"></a>

Go to **CraftForms → PDF Templates** and click **Add New**.

![PDF Templates list with the Add New button](https://97821998-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM2yV1foUgoGHBC66VBDw%2Fuploads%2FQANv3j3E0h7YqCgFx2ph%2FSCR-20260722-izbc.png?alt=media\&token=e3d1cf6f-50b3-456f-8300-072512804c78)

You'll be asked to choose how to start:

* **Choose a starter template** — pre-built layouts with sample content already in place: **Basic Invoice**, **Shipping Label**, **Event Ticket**
* **Start from scratch** — a blank canvas
* **Import from file** — reuse a previously exported PDF template (`.html`)

![Screenshot Create a new PDF template modal showing the starter grid OR divider Start from scratch button and Import from file option](https://97821998-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM2yV1foUgoGHBC66VBDw%2Fuploads%2FMHOs5dfxywEg6hbJVUxr%2FSCR-20260722-izhw.png?alt=media\&token=d31576fa-bc4b-449a-b2c8-49e06726f13d)

> **Tip:** If this is your first PDF template, pick the **Basic Invoice** starter — it already includes a header, itemized table, totals block, and a payment QR code laid out correctly for print.

#### Step 2: Build Your Template in the Block Editor <a href="#step-2-build-your-template-in-the-block-editor" id="step-2-build-your-template-in-the-block-editor"></a>

The PDF template editor is the familiar Gutenberg block editor. Type `/` anywhere to insert a block.<br>

![Screenshot block editor canvas with the  block inserter open](https://97821998-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM2yV1foUgoGHBC66VBDw%2Fuploads%2FNJFI1UNf6TCmEU4IH2ju%2FSCR-20260722-izqf.png?alt=media\&token=1ecf5db7-fabb-455b-a9aa-5de75a462920)

> **Note:** Only PDF-safe blocks are available. PDFs are rendered by a lightweight HTML-to-PDF engine that doesn't support flexbox or CSS grid, so layout blocks (Columns, Group) are automatically compiled into table-based markup behind the scenes — you design visually and don't need to think about this.

To add a QR code or barcode whose value changes with each PDF (a ticket code, an order number), use the **QR Code / Barcode** block. See [QR Code / Barcode](/documentation/pdf-templates/create-pdf-template/qr-code-barcode.md).

The right-hand sidebar has the following panels:

| Panel                 | Purpose                                                                                    |
| --------------------- | ------------------------------------------------------------------------------------------ |
| **Starter Templates** | Re-open the starter picker to swap in a different starting layout                          |
| **Page**              | Page size, orientation, and margins (see Step 3)                                           |
| **Preview**           | Renders the current template as an actual PDF so you can check pagination and print layout |
| **Dynamic Data**      | Browse and insert merge tags for the currently selected form                               |
| **General**           | Template description                                                                       |

#### Step 3: Configure Page Settings <a href="#step-3-configure-page-settings" id="step-3-configure-page-settings"></a>

Open the **Page** panel to control how the document will print:

* **Page size** — A4, A3, A5, Letter, Legal, or Custom (choosing Custom reveals **Width (mm)** and **Height (mm)** fields)
* **Orientation** — Portrait or Landscape
* **Margins (mm)** — four separate fields: **Top**, **Right**, **Bottom**, **Left**

![Screenshot Page panel with Page size Orientation and the four Margins fields](https://97821998-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM2yV1foUgoGHBC66VBDw%2Fuploads%2FHqUj4HlkJ8Wff0wX9c1V%2FSCR-20260722-izyz.png?alt=media\&token=fc8bd1b9-290b-42be-aefa-b69d6bce8bfd)

As you add content, the canvas shows a red guide line marking each page break — useful for keeping tables and totals from splitting awkwardly across pages.

#### Step 4: Use Dynamic Data Tags <a href="#step-4-use-dynamic-data-tags" id="step-4-use-dynamic-data-tags"></a>

Dynamic Data tags pull real values into the document at generation time — no manual editing per submission.

**Site Tags**

| Tag                    | Description         |
| ---------------------- | ------------------- |
| `{{site.name}}`        | Site name           |
| `{{site.url}}`         | Site URL            |
| `{{site.tagline}}`     | Site tagline        |
| `{{site.admin_email}}` | Admin email address |

**Form Field Tags**

\
Select the source form from the **Select Form** dropdown in the Dynamic Data panel, then insert any of its fields. Form field tags always use the `email.` namespace, even inside a PDF template — for example `{{email.name}}`, `{{email.total}}`.

**PDF Document Tags**

| Tag                    | Description                                                |
| ---------------------- | ---------------------------------------------------------- |
| `{{pdf.number}}`       | Submission ID                                              |
| `{{pdf.generated_at}}` | Date/time the document was generated                       |
| `{{pdf.order_id}}`     | Order ID (WooCommerce or Catalog order) — **premium only** |

> **Note:** `{{pdf.number}}` resolves once the PDF is attached to a saved submission; `{{pdf.order_id}}` only resolves when the PDF is tied to a WooCommerce or Catalog order.

![Screenshot Dynamic Data panel showing Select Form Available Tags PDF Document Site Tags and Form Field Tags sections](https://97821998-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM2yV1foUgoGHBC66VBDw%2Fuploads%2F5esP33iH5WAykQFKIbB9%2FSCR-20260722-jaua.png?alt=media\&token=352bdd72-2c06-4a0b-b169-965dc8d68758)

You can also type `{{` directly inside any text block to bring up the same tag menu without leaving the canvas.

![Screenshot inline  tag menu triggered while typing in a paragraph block](https://97821998-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM2yV1foUgoGHBC66VBDw%2Fuploads%2F2ZumpcX3Tc1ZBKzxjfrJ%2FSCR-20260722-jakc.png?alt=media\&token=568b1ab8-5808-423c-8dcf-d0efc6dd8fff)

#### Step 5: Preview and Publish <a href="#step-5-preview-and-publish" id="step-5-preview-and-publish"></a>

Save your draft, then open the **Preview** panel and click **Open the preview** to generate a real PDF from your current content in the **PDF Template Preview** modal — this is the actual rendering engine, so what you see is what recipients will get.

![Screenshot PDF Template Preview modal showing a rendered sample document](https://97821998-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM2yV1foUgoGHBC66VBDw%2Fuploads%2FjRK8D8PUamPydCNcUQ2y%2FSCR-20260722-jbcq.png?alt=media\&token=6fa65f38-4293-4411-9068-53383bedb2f4)

When you're happy with the layout, click **Publish**.

<br>

#### Step 6: Attach Your PDF Template <a href="#step-6-attach-your-pdf-template" id="step-6-attach-your-pdf-template"></a>

A PDF template does nothing on its own — it needs to be attached at one of these points, all labeled **Attach PDF(s)**:

* **Send Email action** — check the template under **Attach PDF(s)** on any email submit action
* **Save Submission action** — check the template under **Attach PDF(s)** to link the generated document to the submission record
* **Catalog item** (WooCommerce) — set **Attach PDF(s)** on the product so a document generates automatically when a connected form is submitted, and is linked to the resulting order

![Screenshot Attach PDFs checkbox list shown on a submit actions settings panel](https://97821998-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM2yV1foUgoGHBC66VBDw%2Fuploads%2FvpgUL6XjNsp700bujd8T%2FSCR-20260722-jbmq.png?alt=media\&token=050af554-4188-4248-b0c0-1ae868d7f8ea)

> **Note:** The same template is only ever generated once per submission or order, even if it's attached in multiple places — CraftForms reuses the already-generated document instead of regenerating it.

#### Quick Tips <a href="#quick-tips" id="quick-tips"></a>

* Use the **Basic Invoice**, **Shipping Label**, or **Event Ticket** starter as a base rather than building from scratch — they already handle print-safe layouts for their format (e.g. the Shipping Label starter uses a 4×6 in custom page size, the Event Ticket starter is A5 landscape).
* Switch the **Select Form** dropdown in Dynamic Data to preview tags from a different form without leaving the template.
* Form field tags are `{{field.fieldname}}`, not `{{pdf.fieldname}}`, even in a PDF template. The older `{{email.fieldname}}` form still works.
* Duplicate a template from the PDF Templates table to quickly create a variant (e.g. a second invoice layout for a different currency).
