SpreadsheetContent
Leave feedback
On this page
Inheritance: java.lang.Object, com.groupdocs.watermark.contents.ContentPart, com.groupdocs.watermark.contents.Content
All Implemented Interfaces: com.groupdocs.watermark.internal.IEncryptable
public class SpreadsheetContent extends Content implements IEncryptable
Represents an Excel document where a watermark can be placed.
Learn more:
- Add watermarks to spreadsheet documents
- Shapes in spreadsheet document
- Working with spreadsheet document attachments
- Working with worksheet backgrounds
- Working with worksheet headers and footers
The following example demonstrates how to load and save Excel content of any supported type.
SpreadsheetLoadOptions loadOptions = new SpreadsheetLoadOptions(); Watermarker watermarker = new Watermarker(“D:\input.xls”, loadOptions);
// Use add method to add watermark to a particular or all worksheets.
// Save changes. watermarker.save(“D:\output.xls”); watermarker.close();
| Method | Description |
|---|---|
| getWorksheets() | Gets the collection of all worksheets of this [SpreadsheetContent](../../com.groupdocs.watermark.contents/spreadsheetcontent). |
| getAsposeCellsWorkbook() | |
| addWatermark(Watermark watermark, SpreadsheetShapeSettings shapeSettings, ISpreadsheetWatermarkEffects effects) | |
| addWatermarkAsBackground(Watermark watermark, int backgroundWidth, int backgroundHeight) | |
| addModernWordArtWatermark(TextWatermark watermark, SpreadsheetShapeSettings shapeSettings) | |
| addWatermarkIntoHeaderFooter(Watermark watermark) | |
| encrypt(String password) | Encrypts the content. |
| decrypt() | Decrypts the document. |
| performSave(String filePath) | |
| performSave(String filePath, SaveOptions saveOptions) | |
| performSave(OutputStream stream) | |
| performSave(OutputStream stream, SaveOptions saveOptions) | |
| getDocumentInfo() | |
| getFileType() | |
| add(Watermark watermark, WatermarkOptions options) | |
| generatePreview(PreviewOptions previewOptions) |
SpreadsheetContent(StreamContainer stream, StrategyManager strategyManager, FileFormatInfo fileFormatInfo, SpreadsheetLoadOptions spreadsheetLoadOptions, WatermarkerSettings watermarkerSettings)
public SpreadsheetContent(StreamContainer stream, StrategyManager<Integer> strategyManager, FileFormatInfo fileFormatInfo, SpreadsheetLoadOptions spreadsheetLoadOptions, WatermarkerSettings watermarkerSettings)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| stream | StreamContainer | |
| strategyManager | com.groupdocs.watermark.internal.StrategyManager<java.lang.Integer> | |
| fileFormatInfo | com.aspose.cells.FileFormatInfo | |
| spreadsheetLoadOptions | SpreadsheetLoadOptions | |
| watermarkerSettings | WatermarkerSettings |
public final SpreadsheetWorksheetCollection getWorksheets()
Gets the collection of all worksheets of this [SpreadsheetContent](../../com.groupdocs.watermark.contents/spreadsheetcontent).
Returns:
SpreadsheetWorksheetCollection - The collection of all worksheets of this [SpreadsheetContent](../../com.groupdocs.watermark.contents/spreadsheetcontent).
public final Workbook getAsposeCellsWorkbook()
Returns: com.aspose.cells.Workbook
addWatermark(Watermark watermark, SpreadsheetShapeSettings shapeSettings, ISpreadsheetWatermarkEffects effects)
public final void addWatermark(Watermark watermark, SpreadsheetShapeSettings shapeSettings, ISpreadsheetWatermarkEffects effects)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| watermark | Watermark | |
| shapeSettings | SpreadsheetShapeSettings | |
| effects | ISpreadsheetWatermarkEffects |
public final void addWatermarkAsBackground(Watermark watermark, int backgroundWidth, int backgroundHeight)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| watermark | Watermark | |
| backgroundWidth | int | |
| backgroundHeight | int |
public final void addModernWordArtWatermark(TextWatermark watermark, SpreadsheetShapeSettings shapeSettings)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| watermark | TextWatermark | |
| shapeSettings | SpreadsheetShapeSettings |
public final void addWatermarkIntoHeaderFooter(Watermark watermark)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| watermark | Watermark |
public final void encrypt(String password)
Encrypts the content.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| password | java.lang.String | The password that will be required to open the document. |
public final void decrypt()
Decrypts the document.
public void performSave(String filePath)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| filePath | java.lang.String |
public void performSave(String filePath, SaveOptions saveOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| filePath | java.lang.String | |
| saveOptions | SaveOptions |
public void performSave(OutputStream stream)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| stream | java.io.OutputStream |
public void performSave(OutputStream stream, SaveOptions saveOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| stream | java.io.OutputStream | |
| saveOptions | SaveOptions |
public IDocumentInfo getDocumentInfo()
Returns: IDocumentInfo
public FileType getFileType()
Returns: FileType
public void add(Watermark watermark, WatermarkOptions options)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| watermark | Watermark | |
| options | WatermarkOptions |
public void generatePreview(PreviewOptions previewOptions)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| previewOptions | PreviewOptions |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.