Documents
A document is a PDF design: a page with a header, a footer and the blocks between them. It is filled in for each person from their profile, the same way a template’s merge tags are.
Documents are part of the Engagement module. Ask your account team to enable Engagement for a workspace.
Find your documents
Open Content and click the Documents tab. Each document is a card that says where it is used: Used in 2 templates, or Not used yet.
Type in Search documents to find one by name. The ⋯ menu on a card has:
| Item | What it does |
|---|---|
| Preview | Shows the saved document as a PDF. |
| Edit document | Opens the document in the editor. |
| Duplicate | Makes a copy named after the original with (copy) added. The copy is a draft. |
| Used in | Lists the templates that use the document. |
| Delete | Deletes the document. |
Anyone who can see templates can see documents. Creating, changing, copying and deleting documents needs permission to edit templates.
Create a document
- On the Documents tab, click New document.
- Type the document’s name at the top left.
- Click a block in the Content tab to add it to the page. It goes below the selected block, or at the end of the page. To add a block to the header or the footer, click Header or Footer on the page first.
- Click a block on the page to change it. Click the back arrow to return to the blocks.
- Click Save.
A name can be up to 200 characters and cannot hold line breaks, tabs or invisible characters. Two documents in a workspace cannot share a name, whatever the letter case.
Blocks
| Block | Use it for |
|---|---|
| Title | A heading. |
| Paragraph | Text, with merge tags such as {{ first_name }}. |
| Image | A picture from the CDN or from a DAM connected to this workspace. |
| Table | Rows and columns of values. |
| Divider | A line across the page. |
| Spacer | Empty space. |
| Barcode | A QR code or a Code 128 barcode, with each person’s own value. |
| Page break | Starts a new page. |
Under Logic, Condition shows what is inside it only when a rule about the person is true, and Repeat shows what is inside it once for each item in a list, such as each transaction on a statement. To make a block conditional after adding it, select it and click Condition under Wrap in.
Images
Click Browse assets on an image to pick a picture from a DAM connected to this workspace, or paste its address into Image URL. An image must come from the CDN or from a DAM connected to this workspace, and its address cannot use a merge tag: every person gets the same picture. Saving a document whose image comes from anywhere else is refused, and the reason shows under Image URL. From a connected Cloudinary account, only images uploaded to that cloud can be used.
If an image cannot be fetched when a person’s PDF is made, that person’s document fails and they are counted under Document failed to render.
Barcodes
Select a barcode to set it:
| Field | What it sets |
|---|---|
| Type | QR code or Code 128. |
| Value | What the code holds. Type / to add a merge tag, such as {{ account_number }}, so each person gets a code of their own. |
| Size | How wide the code is printed, in mm. |
A Code 128 holds letters, digits and symbols only, at most 80 characters, and a QR code holds a limited number of characters. Saving a document whose fixed value does not fit its type is refused, and the reason shows under Value. A document cannot be published while a barcode has no value. When a person’s own value does not fit, their document fails and they are counted under Document failed to render; nobody is sent a broken code. The code is printed sharp at any size.
Tables over a person’s related rows
To list each of a person’s related rows, such as every transaction on a statement:
- Under Logic, add a Repeat and set Repeat over to a list on the document’s model, such as
transactions. Order by sets the order of the rows and At most how many are printed. - Put a Table inside the Repeat. Its first row is the header row, and its next row uses the Repeat’s item, such as
{{ txn.date }}and{{ txn.amount }}.
The table prints one row for each related row and runs across as many pages as it needs. A row is never split across two pages; it moves whole to the next page. A long value with no spaces wraps inside its cell. A person with no related rows gets the header row alone.
Select the table to see Repeat header row on each page, on by default. With it on, every page the table runs onto starts with the header row. The page’s header, footer and page numbers are printed on every page.
A Repeat can only go over a list on the document’s own model. Saving a document whose Repeat goes over any other list is refused with a message naming the list.
Add a Page break to start the next block on a new page.
Merge tags
Click Merge tags to choose the model the document reads from, then bind each merge tag to a field of that model. A document reads from one model.
While a template uses a document, the document cannot move to another model. Remove it from those templates first.
Page settings
Click the Settings tab.
| Setting | Choices |
|---|---|
| Page size | A4 or US Letter. |
| Direction | Left to right, or right to left for languages such as Arabic. |
| Margins | From 5 to 50 mm on every side. |
| Page numbers | None, Page 1 of 3 or 1 / 3, printed in the footer. |
Right-to-left documents
Set Direction to Right to left to write a document in Arabic or another right-to-left language. The page on the canvas is mirrored, and so is the PDF: text starts at the right, a table’s first column is drawn at the right, and Page 1 of 3 is printed in Arabic as صفحة 1 من 3. Arabic letters are joined as they are written. Numbers, Latin words such as a person’s name, and merge-tag values that mix scripts each keep their own order. Text that comes from your data cannot change the direction of the words around it, and a short value such as a name or an order code is placed as one piece, so the words and numbers you wrote beside it stay on their own side of it. A value longer than 30 characters wraps across lines like the rest of the text.
Documents are printed in Noto Sans, and Arabic in Noto Naskh Arabic. A character neither font has cannot be printed.
Save draft and Save
A new document can be kept as a draft: click the arrow beside Save and choose Save draft.
Save publishes the document. Each later Save publishes a new version of it. A published document cannot go back to being a draft.
Preview and download
In the editor, click Preview to see the document as the PDF a person receives. The preview shows what is on the page now, including changes you have not saved. A document must have been saved once before it can be previewed. You can also choose Preview from a card’s ⋯ menu on the Documents tab, which shows the saved document.
The preview shows:
- Every page of the PDF, with the number of pages and the file size under them.
- Every merge tag resolved., or the merge tags that came out empty.
- Sample data: values to fill the merge tags with, written as JSON, such as
{ "first_name": "Priya" }. Click outside the box to preview with them. - Preview as customer: type a customer’s key from the document’s model and click Load, or click the shuffle button to pick one at random. The document is filled from that customer’s profile, and their values appear in Sample data. A key that no customer has is named under the box, and the pages already shown stay.
Click Download to save the PDF shown. A preview is never stored.
Previewing needs permission to view templates. Preview as customer also needs permission to view the model’s records, the same as Preview as customer on a template. A document that takes longer than 10 seconds to render shows a message instead of pages.
Use a document as an email attachment
An email template can attach a published document, and each person then receives their own PDF. See Attachments.
With Zeotap Agent
Ask Zeotap Agent to work on documents in plain words, such as “Make a monthly statement with a table of each customer’s transactions”. Zeotap Agent can:
- List the workspace’s documents and find one by name.
- Read a document: its page settings, its blocks and the merge tags it uses.
- Create a document and change it, including its name, page size, direction and blocks. It is refused for the same reasons a save in the editor is, such as an image from a host that is not allowed.
- Preview a document for sample data or a chosen customer. It tells you the number of pages, the file size and the merge tags that came out empty, and gives you a link to download the PDF. The link stops working after 15 minutes.
Zeotap Agent acts with your permissions: reading and previewing need permission to view templates, and creating and changing documents need permission to edit templates and Engagement on the workspace. Each document it creates or changes is recorded in the workspace’s audit log. Zeotap Agent cannot send a proof of a document.
Delete a document
A document that a template uses cannot be deleted. Remove it from each template first; Used in on its card lists them.