Visual editor
The portal can build a template for you. You place blocks on a page, fill them with text and fields, and the editor writes the HTML and the template syntax behind them. What you see on the page is what the service renders.
A template is either visual or code. A visual template keeps its drawing, and the editor rewrites the code from it on every change. A code template is plain HTML that you edit by hand.
Starting a template
Section titled “Starting a template”The New template dialog offers two ways to begin:
- Blank page or Code, with nothing in them.
- A ready-made template from the gallery, which you then change: an invoice, a quote, a certificate on a portrait page, a certificate on a landscape page, and an invoice written as HTML.
The ready-made templates come with sample data in the language of the portal, so they show a complete document straight away. They are the same documents as the samples on the home page.
Blocks
Section titled “Blocks”The Blocks tab adds the pieces of the page. Click one to add it at the end, or drag it onto the page, or into the list, to the place you want it. Pick a block to change it on the right.
| Block | What it is |
|---|---|
| Heading | A title, in three sizes. |
| Text | A paragraph, with size, weight, color and alignment. |
| List | Bullets or numbers, written by hand or repeated for each item of a list in your data. |
| Image | An uploaded image, or one whose address is a field of your data. |
| Details | Pairs of a label and a value. |
| Table | Columns and rows, written by hand or repeated for each item of a list. |
| QR / barcode | A QR code or a Code 128 barcode of a text or a field. |
| Columns | Blocks side by side, with a width for each column. |
| Line | A rule across the page. |
| Space | Empty height. |
| Page break | Starts a new page. |
The list under the palette, On the page, shows the blocks in order. Drag a block of the page, or a row of the list, to put it somewhere else.
A text or a heading has its own font, chosen from the list of Google Fonts families, each drawn in its own letters, and can also carry a style: capital letters, letter spacing, a line above, below or at the left, and the space around it.
Fields and sample data
Section titled “Fields and sample data”Anywhere you can type text, you can insert a field that reads from your data, such as
{{ customer.name }}. The Data tab holds the sample JSON that the page is drawn with, so
the editor shows real values while you work. The same names are what you send in data when
you render the template.
A field can be formatted with currency, number or date, as in {{ total | currency }}.
The currency is the one set on the page, or the value of a field of your data when the page
names one, so a single template can serve several currencies. The locale of the render
decides how it is written; a text can have a locale of its own, for a date or an amount
that must read another way. See Locales and formatting.
Fields that the sample data does not have are shown in red, so a typo is easy to see.
Tables that repeat
Section titled “Tables that repeat”A table can take its rows from a list in your data. Choose the list, for example items,
and write what each column shows with item, as in {{ item.name }} and
{{ item.amount | currency }}. A column can also have a smaller second line, such as a
description under a name. A table can end with a total row, and its headers can be hidden or
drawn in small capitals.
Conditions and repeats
Section titled “Conditions and repeats”Any block can be shown only when a field has a value, is empty, equals or is not a text, or is above or below a number. A text is compared as it is written, so a number 5 and the text “5” are equal; a number is compared as a number, also when your data writes it as text. In the canvas, a block that is left out by its condition is shown as a dashed note, so you can still pick it.
A block that holds words, a picture, details or columns can also be written once for each
item of a list. Inside it, item is the item. A table or a list in it can read a list that
the item has, as item.lines, and outer is the item of the block that repeats.
Placing things freely
Section titled “Placing things freely”Turn on Free move and drag any block anywhere on the page. It becomes a box with a place and a width, with a handle at its right edge for the width and the numbers in its settings, and Back to the flow puts it back in order. The blocks that flow close the gap it leaves. A block placed this way is on the first page only.
While you move, dashed lines show what lines up with the edges and the middle of other things and of the area the content fills, and the space to the nearest things is drawn with its size in millimetres. Hold Alt, Ctrl or Cmd to move without lining up. The Rulers and the Grid switches add rulers in centimetres along the page and a grid of five millimetres that what you move snaps to.
Picking several things
Section titled “Picking several things”Shift-click adds a thing to what is picked, and Ctrl+A picks everything. What you do to one, you can do to all of them: delete, copy, lock, hide. When things are placed by position, the settings also offer to line them up on the left, the middle or the right, at the top, the middle or the bottom, to space three or more out evenly, and to group them, so that they are picked and moved as one. One thing lines up with the page.
| Key | What it does |
|---|---|
| Delete | Deletes what is picked. |
| Ctrl+D | Copies it next to the original. |
| Arrows | Move what is placed by position by a millimetre, ten with Shift; for blocks in the flow, up and down change the order. |
| Ctrl+C, Ctrl+X, Ctrl+V | Copy, cut and paste, also into another template. |
| Ctrl+Z, Ctrl+Shift+Z | Undo and redo. |
| Esc | Drops the pick. |
| Ctrl+S | Saves. |
A locked block or item can be picked but not moved or changed on the canvas, and a hidden one is left out of the document. The lock and the eye are in the settings, and the lists show a mark.
Styles of text
Section titled “Styles of text”Save the look of a text as a style with a name: size, weight, color, font, spacing and the rest. Give it to another text from the list in its settings, and when you change one text that has the style, you can update the style, which updates every text that has it. Taking a style off a text keeps its look, and so does deleting the style. The Page tab lists the styles.
QR codes and barcodes
Section titled “QR codes and barcodes”The QR / barcode block holds a text with fields, such as
https://example.com/pay/{{ number }}, and draws it as a QR code or as a Code 128 barcode,
with the size, and for a QR code the level of error correction. The code is made when the
document is, from the data of that document, as vector shapes, so it stays sharp. A QR code
holds up to 1000 bytes of text; a barcode holds up to 80 letters, digits and punctuation, without
accents. A field is used as it is, and a missing one draws no code.
The page and the shapes
Section titled “The page and the shapes”The Page tab sets the size (A4 or Letter), the orientation, the margin, the fonts, the text size, the colors, the currency and the date style. Page numbers are off until you ask for them.
The Shapes tab places text, boxes and images by position on the first page, over or under the blocks. Drag an item on the page to move it. Use it for a band of color, a frame or a logo; the blocks keep flowing from the top of the page.
Preview, validation and saving
Section titled “Preview, validation and saving”Validate reports what the renderer could not honor. Preview renders the document with
the real service. A preview is free and limited, and every page of it is marked
PREVIEW - NOT FOR USE in its top margin: it shows what the document will look like, and is not
a document to hand out. A render made through the API is billed and has no mark.
Save the template, then render it by its id. Leaving with changes that are not saved asks first.
History
Section titled “History”Each time you save, the version the template had is kept, up to the latest thirty. The History button lists them with their date. Opening one puts it in the editor as a change that is not saved: you can look at it, change it, undo it, and save it to take the place of the template.
Switching to code
Section titled “Switching to code”Code shows the HTML the blocks make, read only. To change it by hand, choose Code only. The template stops being visual and the drawing is dropped, and this cannot be undone.
What the editor does not do
Section titled “What the editor does not do”The editor writes what the service renders, so it has the same limits as any template; see Supported HTML and CSS. A box in the shapes is a rectangle, with square corners, and what is placed by position is on the first page. For logic beyond a condition on a field and a repeat over a list, write the template as code.