I've seen a few threads around adding watermarks easily to PDFs so I thought I'd share what I put together the other day. This is a watermark that you can enable/disable via conditional text and when enabled, you can change the caption, colour, font-size (whatever you like really) via variables.
Step 1:
Create a new Condition Tag/Set and call it Watermark (for example) - I use a several elements in my PageLayouts that I toggle with conditional text, so my tag is Settings_PageLayouts.Watermark
Step 2:
Create a new Variable set called Watermark and add the HTML attributes you'll want to be able to change in the future (note that you don't need to name them per the HTML spec, I just have out of habit):
Step 3:
In the PageLayout you'd like the watermark to appear on, create a new decoration frame and position it as you'd like the watermark to appear.
Edit the frame contents and add a <p> block with the contents [%=Watermark.Caption%] (assuming you called your Variable set 'Watermark' and the definition you wish to use for the content of your watermark 'Caption').
Conditionally tag the <p> block with your newly added condition from step 1.
Save the frame contents and remember to sink it to the bottom of the canvas (Layout > Depth > Sink to Bottom) to ensure the watermark does not appear on top of the body content of your PDF.
Step 4:
Save and close the PageLayout, then re-open it in the Internal Text Editor
Locate the code for the frame you've just added, it will look something like:
Code: Select all
<Frame X="30px" Y="124px" Width="210px" Height="58px" Flow="decoration4" Right="362px" Bottom="749px">
<Content>
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml">
<xhtml:body>
<xhtml:p MadCap:conditions="Settings_PageLayouts.Watermark">[%=Watermark.Caption%]</xhtml:p>
</xhtml:body>
</xhtml:html>
</Content>
</Frame>
Code: Select all
<xhtml:p xhtml:style="text-align: center;text-transform: [%=Watermark.text-transform%];font-weight: [%=Watermark.font-weight%];font-style: [%=Watermark.font-style%];color: [%=Watermark.color%];font-size: [%=Watermark.font-size%];" MadCap:conditions="Settings_PageLayouts.Watermark">
Save and close the PageLayout, you'll now be able to set up a Print Target to use the selected PageLayout and you'll be able to dynamically change the Watermark each time whenever you need to. I recommend using the Variable settings I posted above, especially the #f0f0f0 colour as it's the closest you'll get to actual transparency.
Hope you find this useful!