SpreadsheetBackgroundWatermarkOptions
Inheritance: java.lang.Object, com.groupdocs.watermark.options.WatermarkOptions, com.groupdocs.watermark.options.SpreadsheetWatermarkOptions
public final class SpreadsheetBackgroundWatermarkOptions extends SpreadsheetWatermarkOptions
Represents options when adding the watermark as a background to a Spreadsheet worksheet.
Learn more:
The following example demonstrates how to add a text watermark to an Excel document worksheet as background.
SpreadsheetLoadOptions loadOptions = new SpreadsheetLoadOptions(); Watermarker watermarker = new Watermarker(“C:\Documents\test.xlsx”, loadOptions);
TextWatermark watermark = new TextWatermark(“Test watermark”, new Font(“Arial”, 36));
SpreadsheetBackgroundWatermarkOptions options = new SpreadsheetBackgroundWatermarkOptions(); options.setWorksheetIndex(-1); // default options.setBackgroundWidth(800); options.setBackgroundHeight(600);
watermarker.save(“C:\Documents\watermarked_test.xlsx”); watermarker.close();
Constructors
Constructor | Description |
---|---|
SpreadsheetBackgroundWatermarkOptions() | Initializes a new instance of the [SpreadsheetBackgroundWatermarkOptions](../../com.groupdocs.watermark.options/spreadsheetbackgroundwatermarkoptions) class. |
Methods
Method | Description |
---|---|
getWorksheetIndex() | Get the index of worksheet to add the watermark to. |
setWorksheetIndex(int value) | Sets the index of worksheet to add the watermark to. |
getBackgroundWidth() | Get the desired width of the background image in pixels. |
setBackgroundWidth(int value) | Sets the desired width of the background image in pixels. |
getBackgroundHeight() | Gets or sets the desired height of the background image in pixels. |
setBackgroundHeight(int value) | Gets or sets the desired height of the background image in pixels. |
SpreadsheetBackgroundWatermarkOptions()
public SpreadsheetBackgroundWatermarkOptions()
Initializes a new instance of the [SpreadsheetBackgroundWatermarkOptions](../../com.groupdocs.watermark.options/spreadsheetbackgroundwatermarkoptions)
class.
getWorksheetIndex()
public final int getWorksheetIndex()
Get the index of worksheet to add the watermark to.
-1 means every worksheet.
Returns: int - The index of worksheet to add the watermark to.
setWorksheetIndex(int value)
public final void setWorksheetIndex(int value)
Sets the index of worksheet to add the watermark to.
-1 means every worksheet.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | The index of worksheet to add the watermark to. |
getBackgroundWidth()
public final int getBackgroundWidth()
Get the desired width of the background image in pixels.
Returns: int - The desired width of the background image in pixels.
setBackgroundWidth(int value)
public final void setBackgroundWidth(int value)
Sets the desired width of the background image in pixels.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | The desired width of the background image in pixels. |
getBackgroundHeight()
public final int getBackgroundHeight()
Gets or sets the desired height of the background image in pixels.
Returns: int - The desired height of the background image in pixels.
setBackgroundHeight(int value)
public final void setBackgroundHeight(int value)
Gets or sets the desired height of the background image in pixels.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int | The desired height of the background image in pixels. |