IDocumentInfo

All Implemented Interfaces: java.io.Closeable

public interface IDocumentInfo extends Closeable

Provides access to document properties.

More details about its usage can be found in Document.getDocumentInfo() method or in a documentation.

Example usage:


 try (Comparer comparer = new Comparer(sourceFile)) {
    try (IDocumentInfo documentInfo = comparer.getSource().getDocumentInfo()) {
      for (int i = 0; i < documentInfo.getPageCount(); i++) {
          System.out.printf("File type: %s%nNumber of pages: %d", documentInfo.getFileType().getFileFormat(), documentInfo.getPageCount());
      }
    }
 }
 

Methods

Method Description
getFileType() Gets a type of the file represented by FileType enum.
setFileType(FileType value) Sets a type of the file using FileType enum.
getPageCount() Gets a count of the file.
setPageCount(int value) Sets a count of the file.
getSize() Gets a size of the file.
setSize(long value) Sets a size of the file.
getPagesInfo() Gets information for each page of the file using PageInfo class.
setPagesInfo(List pageInfos) Sets information for each page of the file using PageInfo class.
close() Destroys the object making it impossible to get information of the document using this instance of IDocumentInfo object.

getFileType()

public abstract FileType getFileType()

Gets a type of the file represented by FileType enum.

Returns: FileType - the type of the file

setFileType(FileType value)

public abstract void setFileType(FileType value)

Sets a type of the file using FileType enum.

Parameters:

Parameter Type Description
value FileType The type of the file

getPageCount()

public abstract int getPageCount()

Gets a count of the file.

Returns: int - the count of the file

setPageCount(int value)

public abstract void setPageCount(int value)

Sets a count of the file.

Parameters:

Parameter Type Description
value int The count of the file

getSize()

public abstract long getSize()

Gets a size of the file.

Returns: long - the size of the file

setSize(long value)

public abstract void setSize(long value)

Sets a size of the file.

Parameters:

Parameter Type Description
value long The size of the file

getPagesInfo()

public abstract List<PageInfo> getPagesInfo()

Gets information for each page of the file using PageInfo class.

Returns: java.util.List<com.groupdocs.comparison.result.PageInfo> - information for each page of the file

setPagesInfo(List pageInfos)

public abstract void setPagesInfo(List<PageInfo> pageInfos)

Sets information for each page of the file using PageInfo class.

Parameters:

Parameter Type Description
pageInfos java.util.List<com.groupdocs.comparison.result.PageInfo> Information for each page of the file

close()

public abstract void close()

Destroys the object making it impossible to get information of the document using this instance of IDocumentInfo object.

Also deletes temporary files and releases used resources.