public interface IDocumentInfo extends Closeable
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());
}
}
}
Comparer| Modifier and Type | Method and Description |
|---|---|
void |
close()
Destroys the object making it impossible to get information of the document using this instance of
IDocumentInfo object. |
FileType |
getFileType()
Gets a type of the file represented by
FileType enum. |
int |
getPageCount()
Gets a count of the file.
|
List<PageInfo> |
getPagesInfo()
Gets information for each page of the file using
PageInfo class. |
long |
getSize()
Gets a size of the file.
|
void |
setFileType(FileType value)
Sets a type of the file using
FileType enum. |
void |
setPageCount(int value)
Sets a count of the file.
|
void |
setPagesInfo(List<PageInfo> pageInfos)
Sets information for each page of the file using
PageInfo class. |
void |
setSize(long value)
Sets a size of the file.
|
void close()
Destroys the object making it impossible to get information of the document using this instance of IDocumentInfo object.
close in interface AutoCloseableclose in interface CloseableFileType getFileType()
Gets a type of the file represented by FileType enum.
int getPageCount()
Gets a count of the file.
List<PageInfo> getPagesInfo()
Gets information for each page of the file using PageInfo class.
long getSize()
Gets a size of the file.
void setFileType(FileType value)
Sets a type of the file using FileType enum.
value - The type of the filevoid setPageCount(int value)
Sets a count of the file.
value - The count of the filevoid setPagesInfo(List<PageInfo> pageInfos)
Sets information for each page of the file using PageInfo class.
pageInfos - Information for each page of the filevoid setSize(long value)
Sets a size of the file.
value - The size of the fileCopyright © 2024. All rights reserved.