Different Types of Watermark in Excel Documents
When you're calling addWatermark method of CellsDocument class, simple shape is added to the Excel document. Besides addWatermark, there is an addModernWordArtWatermark method which accepts only TextWatermark as a parameter. Both methods add watermark to an Excel document as a shape, however, there are some differences. When TextWatermark is added with addWatermark method, it looks and behaves like WordArt object added in Excel 2003, and addModernWordArtWatermark method adds text watermark that looks and behaves like Excel 2013 WordArt object.
The code sample below shows how to add modern WordArt watermark to Excel document worksheet.
The API also provides the feature to set some additional options when adding shape watermark to Excel worksheet (as shown in the below sample).
You can also apply text effects when adding shape watermark in Excel worksheet as shown in the following code sample.
The API also allows you to apply image effects to the shape watermark using below code sample.
Following code sample shows how to add background watermark to all worksheets of Excel document.
Defining Size of the Background
You can also define the size of the background image on which your watermark will be drawn. This feature allows you to mimic watermark relative size and position. Following code sample shows how to achieve this functionality.
Adding Text Watermark as Background
Excel does not support text backgrounds but you still can pass TextWatermark instance to the addWatermarkAsBackground method as shown in the below code sample. The text will be converted to image preserving formatting.
Header & footer Watermark
Adding Image Watermark
Another way to mimic watermark in Excel is to use Headers&Footers. You can add watermark to worksheet's header or footer as shown in the below code sample.
Adding Text Watermark
You can also add text watermark in header or footer as shown in the below code sample.