SpreadsheetBackgroundWatermarkOptions class

SpreadsheetBackgroundWatermarkOptions class

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

Use this class to specify the target worksheet (via worksheet_index) and the size of the background area (via background_width and background_height) for a watermark.

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 worksheet to add the watermark to.

Fields

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

Example

import groupdocs.watermark as gw
import groupdocs.watermark.watermarks as gww
import groupdocs.watermark.options.spreadsheet as gwo_xls

load_options = gw.SpreadsheetLoadOptions()
with gw.Watermarker("spreadsheet.xlsx", load_options) as watermarker:
    watermark = gww.ImageWatermark("logo.gif")
    options = gwo_xls.SpreadsheetBackgroundWatermarkOptions()
    # Apply to the first worksheet (index 0) with default size
    options.worksheet_index = 0
    options.background_width = 800
    options.background_height = 600
    watermarker.add(watermark, options)
    watermarker.save("spreadsheet.xlsx")

See Also