Get file info
Leave feedback
GroupDocs.Redaction provides general document information, which includes:
- FileType
- PageCount
- FileSize
The following code examples demonstrate how to get document information.
final Redactor redactor = new Redactor(stream);
try
{
IDocumentInfo info = redactor.getDocumentInfo();
System.out.println("\nFile type: " + info.getFileType() + "\nNumber of pages: " + info.getPageCount() +
"\nDocument size: " + info.getSize() + " bytes");
}
finally { redactor.close(); }
FileInputStream stream = new FileInputStream("D:\\Sample.docx");
final Redactor redactor = new Redactor("D:\Sample.docx");
try
{
IDocumentInfo info = redactor.getDocumentInfo();
System.out.println("\nFile type: " + info.getFileType() + "\nNumber of pages: " + info.getPageCount() +
"\nDocument size: " + info.getSize() + " bytes");
}
finally
{
redactor.close();
stream.close();
}
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.