IDocumentInfo
Leave feedback
On this page
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());
}
}
}
| 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 |
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. |
public abstract FileType getFileType()
Gets a type of the file represented by FileType enum.
Returns: FileType - the type of the file
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 |
public abstract int getPageCount()
Gets a count of the file.
Returns: int - the count of the file
public abstract void setPageCount(int value)
Sets a count of the file.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | int | The count of the file |
public abstract long getSize()
Gets a size of the file.
Returns: long - the size of the file
public abstract void setSize(long value)
Sets a size of the file.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | long | The size of the file |
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
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 |
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.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.