Docs menu
TemplatesTemplate editor
Template editor
Lay out a document once, put fields where the data goes, and render it with new data from the API.
The template editor lays out a document the way the PDF prints it: the page you see is the page you get. Write the text that stays the same, and put fields where the data goes. Then render it with data from the API or MCP, as often as you like. Account → Templates lists your templates.
Start a template#
- Under Templates, pick a starting point: a basic page, an invoice, a letter, a shipping label or a certificate. Each one comes with sample data, so the first view shows what it does.
- Or import Markdown or HTML: headings, paragraphs, lists, quotes, code and tables become blocks you can edit, and
{{customer.name}}becomes a field. Images are left out and counted. The API and MCP import the same way.
Template and Preview#
The template view shows each field as {{path}}, and a table filled from data as its header and one row of {{column}}, so you can write the text around them. Turn on Preview in the toolbar to see the page with the sample data, as the PDF prints it. The browser remembers your choice. Long lists show their first 300 rows in the editor; the PDF takes them all.
Zones and items#
The Layout list beside the page shows the template as a tree: the page, its zones, and the items in each zone. Click a line to select it; its properties show in the side panel. Click + on a zone to add an item to it. Each zone offers only the items it can hold.
Drag an item in the list to move it within its zone, or press Alt+Up or Alt+Down. In Floating, the list order is the stacking order: the top item lies over the others. Drag a box from Floating onto an empty Zone to fit it there, or back to Floating to set it free.
A click on an item selects it. A double-click on a text opens it for typing. Press Delete to remove the selected item. Right-click an item for its actions, such as duplicate, move up or down, make it floating, or delete. Right-click a zone to remove all its items. The Header, Footer, Left, Right and a Zone you added can be removed the same way. The Body and Floating cannot.
| Name | Type | Description |
|---|---|---|
Page | the sheet | Size, orientation and margins. Its + adds a Header, Footer, Left, Right or a Zone. |
Header, Footer | zone | Prints at the top or bottom of every page. Holds text and page numbers only. |
Left, Right | zone | Prints down the side of every page: a side label. Holds text and page numbers only. |
Body | zone | The main text. Text, tables and graphics follow one another and continue on the next page. |
Zone | zone | A fixed area of the page: a logo place, an address window, a label. Holds one item, or more zones. |
Floating | zone | Items at a free place, on top of everything else: a stamp, a note in the margin. Drag to move, drag a corner to resize. |
| Name | Type | Description |
|---|---|---|
Text | any zone | A paragraph in the Body, a line in a Header, Footer, Left or Right, a text box in a Zone or Floating. |
Page number | Header, Footer, Left, Right | A line with the page number and the page count. |
Table | Body | A table with a header row. Type in the cells; drag the lines between columns to set their widths. |
Image | Zone, Floating | A PNG or JPEG. You can also drop an image file on the page. |
Box, Ellipse, Line | Zone, Floating | A colored rectangle, a circle or an oval, a straight line: a rule or a signature line. |
Barcode | Body, Zone, Floating | Code 128 and GS1-128, EAN, UPC, ITF-14, Data Matrix, PDF417, Aztec and more. The value is fixed or comes from a field. |
QR code | Body, Zone, Floating | A QR code from a fixed value or a field. Presets for a link, a SEPA payment QR, a contact card and Wi-Fi. |
Math | Body, Zone, Floating | A formula in LaTeX notation. |
Diagram | Body, Zone, Floating | A Mermaid diagram: a flowchart, a sequence, a timeline and more. |
Chart | Body, Zone, Floating | A bar, line or pie chart. Draw it from a list makes one bar, point or slice per record of a list or CSV. |
Code | Body, Zone, Floating | A code block with syntax colors. |
SVG | Body, Zone, Floating | An SVG drawing, from its source. |
A graphic in the Body moves down as text grows. A floating one stays where you put it, on the first page or on every page. Switch with In the Body or Floating in its panel.
The SEPA payment preset follows the European Payments Council's QR guidelines (EPC069-12). You are responsible for the payment details in your documents. legivel does not check them against your bank account or your invoice total.
Text
- Select text to get the format bar: style, font, bold, italic, underline, size, color, alignment.
- Type
/in an empty paragraph for headings, tables and page breaks. - Type
{{anywhere in the text to pick a field; Escape keeps the braces as text.
Data and fields#
The Data tab holds the sample data: JSON for the fields, and CSV files for tables. The side panel lists each value of the JSON as a field, with its kind. Drag a field onto the page, or click it:
| Name | Type | Description |
|---|---|---|
Aa, #, Date | text | Into the text under the pointer. Dropped where there is no text, it makes a new paragraph in the body, or a text box outside it. |
List | array of objects | A table with a column per key and one row per record. In the panel, Fill from data picks the list or a CSV file, the key of each column and its format: number, money or date. A column can also be a calculation on the record, or Fields in the cell: type in that column's first row, and {{item.key}} there reads each record, each part in its own style. |
Image | data URL | An image box that takes its image from the data: a PNG or JPEG as data:image/png;base64,…. Links are not fetched. |
When the data misses a value, the Data tab's badge counts the problems and the page shows the path in its place. The API refuses such data with the same list.
Pages#
- Pick A4, Letter, Legal or A5 in the panel, with nothing selected.
- Drag the lines at the page edges to set the margins; the margins hold the Header, Footer, Left and Right.
- Click a Header, Footer, Left or Right line to type in it. Its field list adds the page number and the page count.
- Different first page gives page 1 its own Header, Footer, Left, Right and top and bottom margins, for a letterhead.
- Fonts: Noto Sans by default, Noto Serif, Noto Sans Mono and 50 Google fonts.
Zones and label sheets
Start from a preset under Page, or add a Zone with +. A zone holds one item; add a zone inside a zone to place more side by side or stacked. To make a label sheet, pick a list or CSV under Fill the zones from: each zone takes the next record, left to right, top to bottom, and pages repeat until the records run out. Design the first zone; the other zones repeat it.
Save and use#
Save (⌘S) keeps the page as it is now, with your last 100 undo and 100 redo steps, so undo still works after a reload. A template keeps no older versions: to keep the current state before a bigger change, use Duplicate in the editor's template list or in Account → Templates. The copy gets its own template id and counts toward your plan's templates. Use via API shows the template id and a request that renders it with the sample data. Download PDF renders the page you see, and counts one document.
We generate the PDF in memory and never store the documents you convert or your PDFs. Templates you save are the exception: they are stored encrypted until you delete them.
To build templates in code, see the template format.