com.groupdocs.watermark

Interfaces

Classes

Exceptions

com.groupdocs.watermark

Class LoadOptions



  • public class LoadOptions
    extends Object

    Allows to specify additional options (such as password) when loading a document.

    • Constructor Detail

      • LoadOptions

        public LoadOptions()

        Initializes a new instance of the LoadOptions class.

      • LoadOptions

        public LoadOptions(String password)

        Initializes a new instance of the LoadOptions class.

        Parameters:
        password - The password for opening an encrypted document.
    • Method Detail

      • getPassword

        public final String getPassword()

        Gets the password for opening an encrypted document.

        Returns:
        Can be null or empty string. The default value is null. If the document is not encrypted, set this to null or empty string.

        This example demonstrates how to load a document protected with a password.

        LoadOptions loadOptions = new LoadOptions();
         loadOptions.setPassword("pwd123");
         Document doc = Document.load("D:\\doc.doc", loadOptions);
         // ...
         doc.close();
         
      • setPassword

        public final void setPassword(String value)

        Sets the password for opening an encrypted document.

        Parameters:
        value - Can be null or empty string. The default value is null. If the document is not encrypted, set this to null or empty string.

        This example demonstrates how to load a document protected with a password.

        LoadOptions loadOptions = new LoadOptions();
         loadOptions.setPassword("pwd123");
         Document doc = Document.load("D:\\doc.doc", loadOptions);
         // ...
         doc.close();