- 2 minutes to read
This document describes watermarks: how they can be accessed, assigned to a document’s pages, modified and saved/restored.
For a document’s PrintingSystem, you can specify a watermark (via the PrintingSystemBase.Watermark property), which can be represented by either text or a picture, or both (which is specified via the PageWatermark.Text and PageWatermark.Image properties respectively).
A watermark object is represented by an instance of the Watermark class, and it can be assigned to a document using the Watermark.CopyFrom method, as it is demonstrated in the following tutorial: How to: Add a Watermark to a Document.
When a watermark is specified for a document, it is applied to all pages. To specify individual watermarks for particular pages, use the Page.AssignWatermark method, as demonstrated in the following tutorial: How to: Add Different Watermarks to Document Pages .
And, the following options have effect on image watermarks only.
Finally, the PageWatermark.ShowBehind property is available for both text and image watermarks.
In Print Preview, access to watermark settings is provided by the Watermark toolbar button and the corresponding menu item, both triggering the following printing system command: PrintingSystemCommand.Watermark.
This command raises the Watermark dialog (similar to the one of the PrintingSystemBase.Watermark property) which is used to specify both text and picture watermark options.
Note that these settings can be saved into an XML-file, memory stream or a system registry, and then be restored from there, using appropriate methods. For a tutorial on this, refer to How to: Save and Restore a Document’s Watermark in Print Preview.