com.groupdocs.metadata

Interfaces

Classes

Exceptions

com.groupdocs.metadata

Class DocFormat

    • Constructor Detail

      • DocFormat

        public DocFormat(String fileName)

        Initializes a new instance of the DocFormat class.

        Parameters:
        fileName - The absolute path to the file.
      • DocFormat

        public DocFormat(String fileName,
                 LoadOptions loadOptions)

        Initializes a new instance of the DocFormat class.

        Parameters:
        fileName - The absolute path to the file.
        loadOptions - Additional options to use when loading the document.
      • DocFormat

        public DocFormat(InputStream input)

        Initializes a new instance of the DocFormat class.

        Parameters:
        input - The stream containing the file.
      • DocFormat

        public DocFormat(InputStream input,
                 LoadOptions loadOptions)

        Initializes a new instance of the DocFormat class.

        Parameters:
        input - The stream containing the file.
        loadOptions - Additional options to use when loading the document.
    • Method Detail

      • getType

        public int getType()

        Gets document type.

        Specified by:
        getType in class FormatBase
        Returns:
        Document type.
      • isProtected

        public final boolean isProtected()

        Gets a value indicating whether document is encrypted and requires a password to open.

        Specified by:
        isProtected in interface IProtectableFormat
        Returns:
        true if document is protected; otherwise, false.
      • hasDigitalSignatures

        public final boolean hasDigitalSignatures()

        Gets a value indicating whether document contains DigitalSignature.

        Specified by:
        hasDigitalSignatures in interface ISignedFormat
        Returns:
        true if document has digital signatures; otherwise, false.
        Throws:
        GroupDocsException - Could not read digital signatures. Value: true if document has digital signatures; otherwise, false.
      • getDublinCore

        public final DublinCoreMetadata getDublinCore()

        Gets Dublin Core metadata.

        Specified by:
        getDublinCore in interface IDublinCore
        Returns:
        DublinCoreMetadata if Dublin Core metadata is presented; otherwise null.


        This feature is not supported in trial mode.

      • cleanMetadata

        public void cleanMetadata()

        Removes custom document properties and reset built-in properties.


        This feature is not available in trial mode.

        Overrides:
        cleanMetadata in class FormatBase
      • extractComments

        public final DocComment[] extractComments()

        Extract array of DocComment presented in Word document.

        Returns:
        Returns array of DocComment.


        This feature is not available in trial mode.

      • extractComments

        public final DocComment[] extractComments(String author)

        Extracts array of DocComment presented in Word document by specific author.

        Parameters:
        author - Name of the author.


        This feature is not available in trial mode.

        Returns:
        Returns array of DocComment.
      • clearComments

        public final void clearComments()

        Removes all comments presented in Word document.


        This feature is not available in trial mode.

      • updateComment

        public final void updateComment(int updatingCommentId,
                         DocComment comment)

        Updates the specific comment by id.

        Parameters:
        updatingCommentId - The updating comment identifier.
        comment - The comment.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - Comment id could not be less than zero.
        ArgumentNullException - Comment could not be null.
        GroupDocsException - Could not update comment.
      • getRevisions

        public final RevisionCollection getRevisions()

        Gets a collection of revisions (tracked changes) that exist in this document.


        This feature is not supported in trial mode.

      • getWordsCount

        public final int getWordsCount()

        Gets an estimate of the number of words in the document.

        Returns:
        The number of words.


        This method also updates the value of the P:DocumentProperties.Words property.

      • getPagesCount

        public final int getPagesCount()

        Gets an estimate of the number of pages in the document.

        Returns:
        The number of pages.


        This method also updates the value of the P:DocumentProperties.Pages property.