For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create print layouts and generate PDFs

Learn how to create print layouts, edit them, and generate PDFs from your records.

Create your first print layout

Use a print layout to turn an invoice record into a printable PDF.

Only users with the Admin role can save print layout changes.

1

Open the print editor

In the “Invoices” table, open an invoice record. Click the printer icon in the top right. You can also open the three-dot menu and select Print this record.

The first time you do this in a table, Ninox opens an empty print layout.

2

Add content to the layout

Click + Insert in the top bar and add the elements you need:

  • Text for a static text or a value returned by a script

  • Image, for a static image

  • Data fields from your current table

3

Adjust the layout elements

  • Click an element to highlight its frame. Then drag it to a new position.

  • Drag the square handles to resize it.

  • Click Edit script <> in the top right to update the content of a field or element.

4

Save your changes

Click Save changes when you are finished with the layout.

5

Name the first layout

Enter a Layout name and click Save.

Create another print layout

You can save multiple print layouts in the same table.

Click the arrow next to Save changes. Select Save as to save the current layout under a different name. Then adjust it as needed.

Add a button to generate the invoice PDF

Once you have at least one print layout for your invoices, you can add a button on the “Invoices” table to:

  • Generate a PDF using a defined print layout.

  • Attach the generated PDF to the invoice record.

  • Optionally, display the file in a field on the form view.

1

Add a file field

Add the field to the form view. This field is not required to create and attach the PDF. We recommend it if you want to see the file at a glance in the form view.

2

Add the button and it's logic

Open the Settings panel on the right. Select Form, Add, and drag a Button from the Controls section on the form.

  • In the Button settings, scroll to General and On click.

  • Add the following script:

let myFileName := "Invoice-" + invoice_number + "-" + format(today(), "YYYY-MM-DD") + ".pdf";
do as server
	invoice_pdf := importFile(this, 
														printAndSaveRecord(this, "Invoice"), 
														myFileName)
end
3

What the script does

let myFileName := ... builds a file name for the PDF:

  • "Invoice_" is the fixed prefix.

  • + invoice_number adds the value from the “Invoice number” field to the prefix.

  • + "-" adds a hyphen as separator between the invoice number and the date of today.

  • format(..., "YYYY-MM-DD") formats the date as 2026-08-15.

  • + ".pdf" adds the file extension.

The do as server...end block runs the enclosed code on the server. printAndSaveRecord() must run there.

invoice_pdf := importFile(...) stores the file reference in the "Invoice PDF" field. This lets you display the PDF in the form.

importFile(...) attaches the file to the current record. The file appears in the Files tab.

  • this targets the currently open record.

  • printAndSaveRecord(this, "Invoice") generates a PDF from the current record (this) using the print layout named "Invoice".

  • myFileName provides the generated file name.

Edit layout elements

Existing print layouts stay editable at any time. When you open the print editor, you are already in edit mode.

  • At the bottom of the page, use Show grid to show or hide the grid.

  • Use the Zoom slider to zoom in or out.

  • Use Undo and Redo to reverse or restore changes.

  • Use Cut, Copy, and Paste to reuse recurring styles and content.

  • Open the three-dot menu in the top bar to arrange and align elements:

    • Send to front and Send to back

    • Align left, center, or right

    • Align top, middle, or bottom

    • Distribute horizontally

  • To remove an element, select its frame and click Remove, or press delete or backspace on your keyboard.

Use the settings panel to adjust the layout. Available options depend on what you select.

Select the page to change page settings. Select a text, data, image, or linked table element to adjust its position, size, styling, and display options.

Adjust page settings

Click an empty area or the page margin to edit the page layout. You can set:

  • Paper size

  • Header and footer height

  • Page Margin width

  • Print attachments to include record attachments in the PDF

Adjust element settings for text, logic, or data fields

If you select a text box, logic, or data field, but not an image field, you can set:

  • The page area, such as Flow with content or a repeating Header or Footer

  • A fixed or automatic element Height

  • The exact element Position with X and Y coordinates, plus Width and Height

  • Inner Padding between the content and the element border

  • Colors for the background and text

  • Border color, width, and radius

  • Font family and size

  • Text formatting such as Bold, Italic, or Underline

  • Text alignment

  • Text Line height

Adjust file and image field settings

For a file field and the static image, you can set:

  • The page area, such as Flow with content or a repeating Header or Footer

  • A fixed or automatic height

  • The exact element Position with X and Y coordinates, plus Width and Height

  • Background color for field areas not covered by the image

  • Border color, width, and radius

Adjust content and column settings for linked tables

This section applies when the print layout shows records from a linked table.

Use these settings to control which linked records and columns appear in the PDF. This is useful, for example, when a customer should see only relevant details.

These changes apply only to the print layout. They do not change the underlying linked table.

Select the table shown in the print layout for a field of type Link many records to control its content and presentation in the PDF. You can use all options listed above for Text, Logic, and Data fields, except Text alignment and text Line height.

You can also use these linked-table options:

  • Show header to show or hide the column titles

  • Show footer to show or hide aggregation results for columns where you set an Aggregation

  • Hide columns, Filter, and Sort

  • Border style to choose how the table grid looks

  • Cell padding to define the distance between the value and the cell borders

You can also change table columns directly in the selected table frame:

  • Use x hidden columns, Filter, and Sort at the top right

  • In the drop-down menu for each column:

    • Rename column

    • Duplicate column

    • Insert column left or right

    • Sort in ascending or descending order

    • Aggregation, depending on the data type, which you can display in the footer with Show footer

    • Hide column

Generate a PDF

When your print layout is ready, click Generate document in the top right. By default, the PDF opens in your browser.

Click the arrow next to Generate document to choose what to generate:

  • Generate for selected record

  • Generate for all records This option creates a single PDF containing all records of the open table view on separate pages.

Generate for all records is available only when you open the record from a table view.

Last updated

Was this helpful?