Skip to main content

Designing PDF Outputs with the PDF Builder

How to build, style, and configure a PDF output template using the PDF Builder's visual editor.

Overview

The PDF Builder is the visual editor for your report's PDF output. It's part of the Form Builder (Beta), which users with the Administrator access level open from Settings. You drag components onto a canvas, bind them to your form's data, style them with a built-in CSS editor, and watch the live preview update as you work. As you build, the PDF Builder also flags any data reference that would render blank in the PDF.


Building a template

  1. From the Components tab in the left sidebar, drag an element (Heading, Text, Container, Image, Signature, Compliance Checklist, and more) onto the canvas. It renders immediately at the drop location.

  2. Switch to the Data tab to see the report-data fields available for this form. Drag a field onto the canvas to add it. The builder inserts a new text element next to the element you drop it on (or inside it, for a container). The new element references the field by its key and fills with real report data in the final PDF.

  3. Use the Layout tab to navigate the document tree: click a node to select it on the canvas, or use the tree to nest and reorder elements.

  4. Use the Preview tab at any time to see the template rendered with report data, including page breaks, running headers and footers, and the total page count.


Keeping your PDF output in sync with your form

The PDF Builder binds each element to an input field by the field's key (not by its label). The key comes from the field in the Input Builder.

⚠️ The Input Builder and PDF Builder don't sync automatically. If you change your form, you must update the PDF output to match. When an element references a field the form no longer has, the PDF Builder outlines it in red on the canvas, hovering it shows Unknown field … not found in form definition, and its row in the Layout tab shows a ⚠ warning icon. See Finding Broken Field References below.

When you edit fields in the Input Builder, update the PDF Builder accordingly:

  • Renamed a field's key — update every reference to that field in the PDF output to the new key, or the element will render blank.

  • Removed a field — remove or repoint any PDF elements that referenced it.

  • Added a field — add a matching element in the PDF output if you want the new field to appear.

To find the correct key, open the Data tab, which lists the form's fields by their keys. After any change, use Preview to confirm every field still renders with real data.

Three tools help you keep the two in step. Add fields from form on the Data tab adds an element for each form field that isn't in the template yet. Update PDF label, under a field's label in the Input Builder, changes that label's text in the PDF output to match. Generate label keys, under FORM SYNC on the Settings tab, links each label in the PDF output to its field's key so label updates find the right element.


Finding Broken Field References

The PDF Builder checks every data reference in the template against the fields in the connected form. It runs whenever the builder opens and again each time the template changes. It flags two kinds of problems, and each one would otherwise render blank in the PDF.

Message

What it means

Unknown field "…" — not found in form definition

The reference names a key the form doesn't have — for example, a field that was renamed or removed, or a typo. Keys inside a field group are checked too, for example inspected_by.name.

Invalid expression: …

The expression can't be evaluated — for example, it's missing a bracket or quote — so the element would render blank. The message repeats the expression.

A flagged element shows up in two places:

  • On the canvas, the element has a red outline and a light red background. Hover over it to see each problem on its own line. Each line starts with the part of the element that holds the reference: text for {{ }} text, v-if for a Display if condition, v-for for a Repeat for each list, conditional color for a Conditional color rule, or the name of a bound attribute.

  • In the Layout tab, the element's row shows a warning icon, and hovering the icon lists the same problems. A collapsed row that hides flagged elements shows a small dot instead; hovering it shows Contains fields with validation issues.

To fix a flagged element:

  1. Hover over the element to see which reference is broken.

  2. Open the Data tab and find the field's current key.

  3. Click the element and correct the reference — in Text Content, in its Conditional Statement card, or in the Code tab.

  4. The red outline clears once every reference on the element matches a field in the form.

📝 Flags are informational. They don't stop SAVE or SAVE AND PUBLISH.

📝 The check compares references with the form's fields, not with report data. A field that exists in the form but is empty in a report isn't flagged, and it still renders blank. Some references aren't checked: expressions that call a function, images that have a source set, and references to the repeated item inside a Repeat for each list. If the form has no fields yet, nothing is flagged. Use Preview to confirm the output.


Styling elements with the CSS Editor

Click any element on the canvas (or in the Layout tree) to open the CSS Editor panel on the right:

  • The breadcrumb at the top shows the element's ancestor path (for example div › section › article › h1); click any segment to jump selection up the tree.

  • The element's tag, ID, and classes are listed below the breadcrumb.

  • Text Content edits the element's text inline.

  • Conditional Statement drives behavior from data: Display if (show the element only when a condition is met), Conditional color, and Repeat for each (repeat the element for every item in a list — for example one row per deficiency).

  • Add directive covers advanced bindings the built-in cards don't.

  • Grouped property editors show each computed value with an override input. The canvas updates in real time as you type.

  • Use Duplicate Element or Delete Element (with confirmation) as needed; close the editor with × or Esc.


Page settings

Open the Settings tab in the left sidebar to control the page itself:

  1. Page Size — A4, A3, A5, Letter, Legal, or Tabloid, each listed with its size in millimeters. If the template's page size matches none of these, the list shows Custom with Width and Height inputs in millimeters.

  2. Orientation — Portrait or Landscape; the canvas and ruler swap immediately.

  3. Margins (mm) — four inputs around the page icon (Top, Right, Bottom, Left).

  4. Header & Footer — Enable header/footers turns running headers and footers on. When it's on, Show header on first page and Show footer on first page control the first page separately, so a cover page can omit them. If Enable header/footers is locked (its tooltip reads Page.js is required for this form and can't be disabled), headers and footers stay on for that form.

  5. Display Options — editing aids: Absolute positioning, Show All Layers, Show All V-Statements.

Page Size, Orientation, Margins, and Header & Footer are part of the template and apply to the Preview tab and the generated PDF. Display Options are editing aids only: they aren't kept with the template and reset when you reload the builder. Turning Absolute positioning off doesn't move elements you've already placed with it.


Saving

Changes save automatically after a short pause. SAVE updates the form's current draft, or starts a new draft if the form doesn't have one (for example, right after a publish), and SAVE AND PUBLISH publishes the draft. You can revert the form only to a version that was published, not to a draft (see Viewing, Comparing, and Restoring Form Versions).


FAQ

Q: My preview looks different from what I expected — why?
A: The preview renders using the record selected in the Report: list on the Report Data tab. Preview, the default, uses the form's preview data; you can also choose one of the form's existing reports. If a bound field is empty in that record, the corresponding element may render blank.

Q: I edited my form and now part of the PDF is blank — why?
A: The PDF Builder references input fields by their key, and the two builders don't sync automatically. If you renamed or removed a field in the Input Builder, the PDF element still points at the old key and renders blank. Look for elements outlined in red, update each reference to match the field's current key — use the Data tab to find it — then check Preview.

Q: Some elements are outlined in red, and I haven't changed anything. Why?
A: The PDF Builder checks the whole template each time it opens, including references that were already broken before. Hover over the element to read the message. Unknown field means the key isn't in the form. Invalid expression means the expression itself can't be evaluated.

Q: My PDF is blank, but nothing is outlined in red. What else can cause it?
A: The check covers references that don't match the form, and expressions that can't be evaluated. It doesn't cover a field that exists in the form but is empty in the report, or references it skips, such as function calls and references to the repeated item inside a Repeat for each list. Pick a real report in the Report: list on the Report Data tab and check Preview.

Q: Can I save a template that still has flagged elements?
A: Yes. Flags don't block SAVE or SAVE AND PUBLISH. A flagged element still renders blank in the PDF until its reference is fixed.

Q: Can I get more control than the visual editor offers?
A: Yes — switch to the Code tab to edit the template's HTML and CSS directly. See Editing Templates with HTML & CSS (Code Mode).


Related Articles

Did this answer your question?