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:
<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:
Click 'Encode' and copy the generated data below it:
In the template, navigate to the ‘Init variables' step within the main flow, and set a variable 'draftSvg’ as:
The value being data:image/svg+xml;base64,+ the generated code above.
Apply the draftSvg variable in the 'Document print style' style sheet:
The output when testing will be as follows: