Logo

PDFBlaze

Data is what turns a template into many different PDFs. Every template has a list of data fields, for example the name of a customer or the items on an invoice. In the editor you connect your text, images and lists to these fields, and when you generate a PDF through the API you send the actual values for them.

The data fields are found in the “Data” tab on the left side of the editor. If you started from one of the presets, the fields are already set up and filled with sample values, so it is worth having a look at them to get a feeling for how things fit together.

The data tab with the fields of an invoice and the details of the items list

Adding fields

Click “Add field” to create a new field. Every field has a name and a type. Clicking a field in the list opens its details on the right side, where you can rename it, change its type and set a sample value. The name is what you use in your API requests, so it is a good idea to keep it short and without spaces, for example invoiceNumber or dueDate.

Most fields will be Text, which covers names, addresses, notes and anything else that is just text. Quantities, prices and totals are a Number, which can later be shown as a currency. A Date is sent as 2026-03-24 and you decide in the template how it is written out. Yes/No fields are mostly used to show or hide parts of a document, and an Image field is for a picture that changes per document, like a product photo or a signature. To keep related fields together, for example a customer with a name and an email, you use a Group. Anything that repeats, like the lines of an invoice or the lines of an address, is a List.

Groups and lists can be opened with the small arrow in front of them, and the plus that shows up when you hover over one adds a field inside it. A group contains its own fields. For a list you choose what one entry looks like under “Each item is”, which can be a simple value or a group with several fields.

Fields can be marked as required in their details and get a small star in the list. A request that leaves out a required field is rejected with an error that says which field is missing, so nothing half filled gets generated. Fields that are not required can simply be left out of a request and will show up empty.

Sample data

Every field has a sample value, which is shown in the list and can be changed in the details of the field. The editor uses these values to show what your document will look like, and “Preview PDF” uses them as well. The sample items of a list are edited in a table that opens with “Edit sample items”. You can add as many as you like, which is handy to check how a long table breaks across pages, and if you prefer you can edit the same items as JSON there.

If you already have the JSON that your system will send, you don’t need to type it all in. Click “Import JSON”, paste it and the sample data is replaced. Any fields in the JSON that the template doesn’t know yet can be added to the template in the same step.

Where a field is used

The number next to a field shows how many elements use it, and hovering over the field highlights them on the page. In the details of a field they are listed under “Used in”. Clicking one selects it on the page while the field stays open, so you can go through all of them one by one. It also works the other way round. Click a field in the “Content” box of a text and then “Show field” to get to its details.

Deleting a field that is still used asks first. The elements keep pointing at the missing field and show up as problems until you change them.

Using fields in text

To show a field in a text, click into the text and choose “Insert field” in the sidebar, or select a part of the text and use the “Field” button in the floating toolbar. The field shows up with its sample value and can be styled like the text around it. A text can contain as many fields as you need, mixed with normal text, for example “Due on” followed by the due date. If the field doesn’t exist yet, choose “New field…” in the same menu. It adds the field and puts it into the text in one go.

In the sidebar, the “Content” box shows the text of the selected element with its fields as small chips. You can type there just like on the page, remove a field with the cross on its chip and drag a chip to move the field to another spot. Clicking a chip lets you pick a different field and choose how the value is formatted. Numbers can be shown as they are, with thousands separators and a fixed number of decimals, or as a currency like $1,234.50. Dates can be short (3/1/26), medium (Mar 1, 2026), long (March 1, 2026) or with the weekday, and for anything else there is a custom pattern. Text can be shown in UPPERCASE or lowercase.

You can also set the language for a field, which changes things like the decimal separator or the names of months. The preview below the options shows your sample value with the format applied, so you can see right away if it is what you want.

Calculations

PDFBlaze does not calculate anything. Totals, taxes and the amount of each line need to be part of the data you send. This keeps the template simple and makes sure the numbers in the PDF are exactly the numbers in your system.

Repeating parts of a document

Any element can be repeated for each item of a list. Select it and choose the list under “Repeat for each item of” in the “Data” section of the sidebar. The editor suggests a name for the current item, for example item for a list called items, and inside the repeated element you can then use fields like item.description. If a list contains simple values, like the lines of an address, the item itself is the value.

Inside a repeated element there is also item_index, the position in the list starting at 0. For a list of lines on an invoice, a table is usually the better choice, see tables.

The template editor with a repeated row selected and its data settings

Showing parts only sometimes

Under “Show only if” an element can be shown depending on a field. “has a value” shows it when the field is filled in, which works well for optional things like a discount line, a note or a second address line. “equals” and “is not” compare the field with a value you enter, for example to show a “PAID” stamp only when status equals paid. Anything that is hidden doesn’t take up any space in the document.

Images from data

For an image element you can choose a field under “Image from data” instead of a fixed image from your library. The value you send for that field is either an https link to the image or the id of an image you uploaded, written as { "asset": "<image id>" }. Combined with “Show only if” this is a nice way to have an optional logo.