@Deprecated public class CellsDocument extends Document
Represents an Excel document where a watermark can be placed.
This example demonstrates how to load and save Excel document of any supported type.
CellsDocument document = Document.load(CellsDocument.class, "D:\\input.xls"); // Use addWatermark method to add watermark to all worksheets. // Use the collection of frames to add watermark to a particular worksheet. // Save changes. document.save("D:\\output.xls"); document.close();
Modifier and Type | Method and Description |
---|---|
void |
addImageWatermark(ImageWatermark watermark,
CellsImageEffects effects)
Deprecated.
Adds an image watermark to all worksheets of this
CellsDocument . |
void |
addImageWatermark(ImageWatermark watermark,
CellsImageEffects effects,
CellsShapeSettings shapeSettings)
Deprecated.
Adds an image watermark to all worksheets of this
CellsDocument . |
void |
addModernWordArtWatermark(TextWatermark watermark)
Deprecated.
Adds a rectangular shape with text inside to all worksheets of this
CellsDocument . |
void |
addModernWordArtWatermark(TextWatermark watermark,
CellsShapeSettings shapeSettings)
Deprecated.
Adds a rectangular shape with text inside to all worksheets of this
CellsDocument . |
void |
addTextWatermark(TextWatermark watermark,
CellsTextEffects effects)
Deprecated.
Adds a text watermark to all worksheets of this
CellsDocument . |
void |
addTextWatermark(TextWatermark watermark,
CellsTextEffects effects,
CellsShapeSettings shapeSettings)
Deprecated.
Adds a text watermark to all worksheets of this
CellsDocument . |
void |
addWatermark(Watermark watermark,
CellsShapeSettings shapeSettings)
Deprecated.
Adds a watermark to all worksheets of this
CellsDocument . |
void |
addWatermarkAsBackground(Watermark watermark)
Deprecated.
Adds a watermark to all worksheets of this
CellsDocument as backgrounds. |
void |
addWatermarkAsBackground(Watermark watermark,
int backgroundWidth,
int backgroundHeight)
Deprecated.
Adds a watermark to all worksheets of this
CellsDocument as backgrounds. |
void |
addWatermarkIntoHeaderFooter(Watermark watermark)
Deprecated.
Adds a watermark into the header or footer of all worksheets contained in this
CellsDocument . |
void |
decrypt()
Deprecated.
Decrypts the document.
|
protected void |
dispose(boolean disposing)
Deprecated.
Releases all resources used by the
CellsDocument |
void |
encrypt(String password)
Deprecated.
Encrypts the document.
|
CellsWorksheetCollection |
getWorksheets()
Deprecated.
Gets the collection of all worksheets of this
CellsDocument . |
close, dispose, getDefaultSearchableObjects, getInfo, getInfo, getSearchableObjects, load, load, load, load, load, load, load, load, save, save, setDefaultSearchableObjects, setSearchableObjects
addWatermark, findImages, findImages, findWatermarks, findWatermarks
public final CellsWorksheetCollection getWorksheets()
Gets the collection of all worksheets of this CellsDocument
.
CellsDocument
.
This example demonstrates how to add watermark to a particular worksheet.
CellsDocument document = Document.load(CellsDocument.class, "D:\\input.xls"); // Initialize text or image watermark. TextWatermark watermark = new TextWatermark("DRAFT", new Font("Arial", 19)); // Add watermark to a particular worksheet. document.getWorksheets().get_Item(0).addWatermark(watermark); // Save changes. document.save("D:\\output.xls"); document.close();
public final void addWatermark(Watermark watermark, CellsShapeSettings shapeSettings)
Adds a watermark to all worksheets of this CellsDocument
.
This method assumes that watermark offset and size are measured in points (if they are assigned).
watermark
- The watermark to add to the document.shapeSettings
- Settings that should be applied to the watermark.public final void addImageWatermark(ImageWatermark watermark, CellsImageEffects effects, CellsShapeSettings shapeSettings)
Adds an image watermark to all worksheets of this CellsDocument
.
This method assumes that watermark offset and size are measured in points (if they are assigned).
watermark
- The image watermark to add to the document.effects
- Image effects that should be applied to the watermark.shapeSettings
- Shape settings that should be applied to the watermark.public final void addImageWatermark(ImageWatermark watermark, CellsImageEffects effects)
Adds an image watermark to all worksheets of this CellsDocument
.
This method assumes that watermark offset and size are measured in points (if they are assigned).
watermark
- The image watermark to add to the document.effects
- Image effects that should be applied to the watermark.public final void addTextWatermark(TextWatermark watermark, CellsTextEffects effects, CellsShapeSettings shapeSettings)
Adds a text watermark to all worksheets of this CellsDocument
.
This method assumes that watermark offset and size are measured in points (if they are assigned).
watermark
- The text watermark to add to the document.effects
- Text effects that should be applied to the watermark.shapeSettings
- Shape settings that should be applied to the watermark.public final void addTextWatermark(TextWatermark watermark, CellsTextEffects effects)
Adds a text watermark to all worksheets of this CellsDocument
.
This method assumes that watermark offset and size are measured in points (if they are assigned).
watermark
- The text watermark to add to the document.effects
- Text effects that should be applied to the watermark.public final void addWatermarkAsBackground(Watermark watermark, int backgroundWidth, int backgroundHeight)
Adds a watermark to all worksheets of this CellsDocument
as backgrounds.
This method assumes that watermark offset and size are measured in pixels (if they are assigned).
Backgrounds are viewable in Normal View in worksheet, and are invisible in Page Layout mode.
The image is automatically tiled on the background of the worksheet.
watermark
- The watermark to add to the document.backgroundWidth
- Desired width of the background image in pixels.backgroundHeight
- Desired height of the background image in pixels.
public final void addWatermarkAsBackground(Watermark watermark)
Adds a watermark to all worksheets of this CellsDocument
as backgrounds.
This method assumes that watermark offset and size are measured in pixels (if they are assigned).
Backgrounds are viewable in Normal View in worksheet, and are invisible in Page Layout mode.
The image is automatically tiled on the background of the worksheet.
watermark
- The watermark to add to the document.
public final void addModernWordArtWatermark(TextWatermark watermark, CellsShapeSettings shapeSettings)
Adds a rectangular shape with text inside to all worksheets of this CellsDocument
.
This method assumes that watermark offset and size are measured in points (if they are assigned).
watermark
- The text watermark to add to the document.shapeSettings
- Settings that should be applied to a shape watermark.public final void addModernWordArtWatermark(TextWatermark watermark)
Adds a rectangular shape with text inside to all worksheets of this CellsDocument
.
This method assumes that watermark offset and size are measured in points (if they are assigned).
watermark
- The text watermark to add to the document.public final void addWatermarkIntoHeaderFooter(Watermark watermark)
Adds a watermark into the header or footer of all worksheets contained in this CellsDocument
.
This method assumes that watermark offset and size are measured in points (if they are assigned).
You’ll see the watermark in Excel only when you’re in Page Layout view or Print Preview.
watermark
- The watermark to add to the document.public final void encrypt(String password)
Encrypts the document.
password
- The password that will be required to open the document.public final void decrypt()
Decrypts the document.
Copyright © 2020. All rights reserved.