SpreadsheetWatermarkShapeOptions class

SpreadsheetWatermarkShapeOptions class

Represents options when adding shape watermark to a Spreadsheet worksheet.

Learn more:

The SpreadsheetWatermarkShapeOptions type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the SpreadsheetWatermarkShapeOptions class.

Properties

Property Description
effects The effects applied to the watermark, specified as a SpreadsheetImageEffects or SpreadsheetTextEffects instance.
worksheet_index The index of the worksheet to add the watermark to.
alternative_text The descriptive (alternative) text that will be associated with a shape. (inherited from SpreadsheetWatermarkBaseOptions)
is_locked The property indicates whether editing of the shape in Excel is forbidden. (inherited from SpreadsheetWatermarkBaseOptions)
name The name of the shape. (inherited from SpreadsheetWatermarkBaseOptions)

Fields

Field Description
DEFAULT Gets the default value for the class. (inherited from WatermarkOptions)

Example

from groupdocs.watermark import Watermarker
from groupdocs.watermark.watermarks import TextWatermark, Font, Color
from groupdocs.watermark.common import HorizontalAlignment, VerticalAlignment
from groupdocs.watermark.options.spreadsheet import (
    SpreadsheetLoadOptions, SpreadsheetWatermarkShapeOptions,
)

def add_watermark_to_worksheet():
    with Watermarker("./spreadsheet.xlsx", SpreadsheetLoadOptions()) as watermarker:
        watermark = TextWatermark("CONFIDENTIAL", Font("Arial", 19.0))
        watermark.foreground_color = Color.red
        watermark.horizontal_alignment = HorizontalAlignment.CENTER
        watermark.vertical_alignment = VerticalAlignment.CENTER

        options = SpreadsheetWatermarkShapeOptions()
        options.worksheet_index = 0
        watermarker.add(watermark, options)

        watermarker.save("./output.xlsx")

See Also