SpreadsheetWatermarkShapeOptions

SpreadsheetWatermarkShapeOptions class

Represents options when adding shape watermark to a Spreadsheet worksheet.

public sealed class SpreadsheetWatermarkShapeOptions : SpreadsheetWatermarkBaseOptions

Constructors

Name Description
SpreadsheetWatermarkShapeOptions() Initializes a new instance of the SpreadsheetWatermarkShapeOptions class.

Properties

Name Description
AlternativeText { get; set; } Gets or sets the descriptive (alternative) text that will be associated with a shape.
Effects { get; set; } Gets or sets a value of SpreadsheetImageEffects or SpreadsheetTextEffects for effects that should be applied to the watermark.
IsLocked { get; set; } Gets or sets a value indicating whether an editing of the shape in Excel is forbidden.
Name { get; set; } Gets or sets the name a shape.
WorksheetIndex { get; set; } Gets or sets the index of worksheet to add the watermark to.

Remarks

Learn more:

Examples

Add watermark to a particular worksheet of an Excel document.

SpreadsheetLoadOptions loadOptions = new SpreadsheetLoadOptions();
using (Watermarker watermarker = new Watermarker(@"C:\Documents\test.xls", loadOptions))
{
    TextWatermark watermark = new TextWatermark("Test watermark", new Font("Arial", 36, FontStyle.Bold | FontStyle.Italic));
    watermark.HorizontalAlignment = HorizontalAlignment.Center;
    watermark.VerticalAlignment = VerticalAlignment.Center;

    SpreadsheetWatermarkShapeOptions options = new SpreadsheetWatermarkShapeOptions();
    options.WorksheetIndex = 0;

    watermarker.Add(watermark, options);
    watermarker.Save();
}

See Also