# Document templates

> Building reusable templates with variables, drafting with AI from a template, and exporting a document as PDF or DOCX.

A template is a document you intend to reuse, such as a service contract or a
standard letter, with placeholders for the details that change from one case
to the next. Templates live under the **Templates** tab of the Documents
page.

## Creating a template

Start a new template with **New template** on the Templates tab, or turn an
existing document into one from its menu (**Save as template** and back again
with **Convert to document**). Give it a name and a document type, so it
groups correctly alongside your other document types on the case tab and in
the create-from-template menu.

(Screenshot: The Templates tab of the Documents page: three templates, each with its type, Draft document and Use template, and New template at the top right.)

You can also import an existing `.docx` file as a starting point instead of
building one from scratch.

## Variables

A template can contain `{{variable}}` placeholders that Lethra fills in from
the case and company. The **Variables** panel in the document editor lists what
is available:

- **Case variables**, such as the deceased's name, dates of birth and death,
  and the primary contact's name, email, phone and relation.
- **Company variables**, such as your firm's name, address, phone and
  website.
- **General variables**, such as today's date and the signed-in user's email.

(Screenshot: A template open in the editor, an obituary with variables such as full_name and date_of_death in double curly braces, and the AI assistant beside it.)

From the panel you can click a variable to add it to the end of the
document, pick the **Linked case**, and use **Resolve all** to fill in every
variable already in the document from that case at once. Values that cannot
be found are left blank rather than guessed.

(Screenshot: The Variables panel next to a template, linked to Margriet Vandenberghe's case: each variable with the value it would get, and Resolve all at the top.)

## Using a template

On the Templates tab, each template has two buttons. **Use template** makes a
fresh copy for you to work on, and **Draft document** has the agent fill it
in, as described below. You can also start from a template on a case,
with **New draft** and **From template** on its Documents tab.

## Drafting with AI from a template

Click **Draft document** on a template to have the agent produce a
filled-in draft in one step. In the **Draft with AI** window, pick the case
it should draft for (or none), add any extra instructions in plain language,
and Lethra generates a new document from the template and opens it in the
editor, ready to check.

(Screenshot: The Draft with AI window for the Obituary template, linked to Margriet Vandenberghe's case, with extra instructions about the bakery and a donation instead of flowers.)

(Screenshot: A finished obituary for Margriet Vandenberghe in the document editor, with the AI assistant and its quick actions on the right.)

> **Note:** This creates a draft for you to review. It does not send anything or file
> anything on its own; you still decide what happens to the finished document.
## Generating a PDF or DOCX

From the document editor's menu you can:

- **Export Word (.docx)**, which gives you the file as Word would save it.
- **Export PDF**, which uses your browser's print output to produce a PDF of
  the document exactly as rendered on screen.

(Screenshot: The menu in the document editor: Export Word (.docx), Export PDF, Save as template and Delete document.)

There is no separate print or export hub. Both options live in that one menu
on the document itself, so exporting is always the last step after you have
finished editing.

## Next

Uploading and sharing files: [Documents](/docs/documents-hub/documents/).

Source: https://lethra.ai/docs/documents-hub/templates/
