Skip to main content
Skip table of contents

Create a Conditional Watermark

A watermark can be conditioned to appear based on user selection, or data from Salesforce. This page shows how to create an SVG watermark and apply it to the template.

For example, you can configure a “DRAFT” watermark to appear in the document if the Salesforce status of the relevant record is in “Draft”, “In Review” etc..

This way, if a copy of the document is downloaded or gets shared in any other way, it will have the DRAFT watermark in it.

The following website (or similar) can be used to encode an SVG: https://www.base64encode.org/.
To begin you can use the following svg code:

CODE
<svg height="25.7cm" width="17cm" xmlns="http://www.w3.org/2000/svg">
<rect x="0" y="0" height="25.7cm" width="17cm" fill="white"/>
<text x="-15%" y="60%" text-anchor="middle" fill="silver" font-family="monospace" font-size="180" transform="rotate(-45)">DRAFT</text> 
</svg>

The above svg code assumes default margins for the template:

image-20240710-065134.png

Click 'Encode' and copy the generated data below it:

image-20240710-063822.png

In the template, navigate to the ‘Init variables' step within the main flow, and set a variable 'draftSvg’ as:

image-20240710-064313.png

The value being data:image/svg+xml;base64,+ the generated code above.

Apply the draftSvg variable in the 'Document print style' style sheet:

image-20240710-080200.png

The output when testing will be as follows:

image-20240710-094938.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.