com.groupdocs.watermark.contents

Interfaces

Classes

com.groupdocs.watermark.contents

Class SpreadsheetContent

  • All Implemented Interfaces:
    Closeable, AutoCloseable


    public class SpreadsheetContent
    extends Content

    Represents an Excel document where a watermark can be placed.

    This 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 Detail

      • getWorksheets

        public final SpreadsheetWorksheetCollection getWorksheets()

        Gets the collection of all worksheets of this SpreadsheetContent.

        Returns:
        The collection of all worksheets of this SpreadsheetContent.
      • encrypt

        public final void encrypt(String password)

        Encrypts the content.

        Parameters:
        password - The password that will be required to open the document.
      • decrypt

        public final void decrypt()

        Decrypts the document.

      • performSave

        public void performSave(OutputStream stream)

        Saves the document to the specified stream.

        Specified by:
        performSave in class Content
        Parameters:
        stream - The stream to save the document data to.
      • performSave

        public void performSave(OutputStream stream,
                       SaveOptions saveOptions)

        Saves the document to the specified stream.

        Specified by:
        performSave in class Content
        Parameters:
        stream - The stream to save the document data to.
        saveOptions - The options tha should be used when saving the content data.