SpreadsheetBackgroundWatermarkOptions class

SpreadsheetBackgroundWatermarkOptions class

Represents options when adding the watermark as a background to a Spreadsheet worksheet.

Learn more: https://docs.groupdocs.com/display/watermarknet/Add+watermarks+to+spreadsheet+documents

The SpreadsheetBackgroundWatermarkOptions type exposes the following members:

Constructors

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

Properties

Property Description
background_height The desired height of the background image in pixels.
background_width The desired width of the background image in pixels.
worksheet_index The index of the worksheet to add the watermark to.

Fields

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

Example

from groupdocs.watermark import Watermarker
from groupdocs.watermark.options.spreadsheet import SpreadsheetLoadOptions, SpreadsheetBackgroundWatermarkOptions
from groupdocs.watermark.watermarks import TextWatermark, Font

load_options = SpreadsheetLoadOptions()
with Watermarker(r"C:\Documents\test.xlsx", load_options) as watermarker:
    watermark = TextWatermark("Test watermark", Font("Arial", 36))

    options = SpreadsheetBackgroundWatermarkOptions()
    options.worksheet_index = -1  # default
    options.background_width = 800
    options.background_height = 600

    watermarker.add(watermark, options)
    watermarker.save()

See Also