0

Test print with watermark

Download and print a test PDF to verify that the rendered report contains the desired data and looks as expected in your layout

ℹ️ The test print contains a watermark. The proof print contains a watermark. The final, "real" print will not have a watermark.

Either toggle ON the option Test print in the Ninox UI, or alternatively use a custom script and the functions printRecord or printAndSaveRecord.

Option A: without a custom script (Ninox UI)

Option A: Toggle ON Test print (1), then click Print (2) to download a test PDF with a watermark

✅ Using data from example: invoice PDF, view the files below: a test print with a watermark and a final print without a watermark.

Test print with watermark.pdf

Final print without watermark.pdf

Option B: with a custom script

ℹ️ Works with printRecord or printAndSaveRecord.
printRecord(this, "templateLayoutName", data)
printAndSaveRecord(this, "templateLayoutName", data)

The data object can include the property _options with testPrint which overrides the default settings set by the print engine in the Ninox UI, i.e., if you previously toggled OFF Test print.

Example

  1. Add a new layout element, here: a button.
  2. Paste the script below in the formula editor.
  3. Save changes.
  4. Click or tap the button to run the script.
printRecord(this, "en_invoice_template", {
    date: "02.09.2022",
    notes: "Net 30",
    invoiceNumber: "RE-00001",
    totalNet: "1,342.30 €",
    totalGross: "€1,597.34",
    paymentTerm: "30.09.2022",
    vat: [{
            rate: "19%",
            amount: "€255.04"
        }],
    customer: {
        companyName: "Happy GmbH & Co. KG",
        salutation: "Mrs.",
        lastName: "Sorglos",
        department: "Purchasing",
        address: "Willy-Brandt-Weg 2",
        postalCode: "10178",
        city: "Berlin"
    },
    contact: {
        name: "Elsa Excel",
        phone: "(030) 234 567 89",
        email: "elsa.excel@ninox.com"
    },
    items: [{
            pos: 1,
            article: "Ninox Cloud",
            number: 10,
            price: "€120.00",
            sum: "€1,200.00"
        }, {
            pos: 3,
            article: "Ninox coffee cup (porcelain)",
            number: 5,
            price: "€7.50",
            sum: "€37.50"
        }, {
            pos: 4,
            article: "Ninox coffee cup (recycled)",
            number: 10,
            price: "€0.49",
            sum: "€4.90"
        }, {
            pos: 5,
            article: "Ninox basecap",
            number: 10,
            price: "€9.99",
            sum: "€99.90"
        }],
    _options: {
        testPrint: true
    }
})

Result

A report (PDF file) is created and downloaded to your local files.

Reply

null