Get file info
Leave feedback
On this page
GroupDocs.Redaction provides general document information, which includes:
- FileType
- PageCount
- FileSize
The following code examples demonstrate how to get document information.
const redaction = require('@groupdocs/groupdocs.redaction');
const redactor = new redaction.Redactor(stream);
try
{
const info = redactor.getDocumentInfo();
console.log('\nFile type: ' + info.getFileType() + '\nNumber of pages: ' + info.getPageCount() +
'\nDocument size: ' + info.getSize() + ' bytes');
}
finally {
redactor.close();
}
const redaction = require('@groupdocs/groupdocs.redaction');
const stream = new FileInputStream('D:\\Sample.docx');
const redactor = new redaction.Redactor('D:\Sample.docx');
try
{
const info = redactor.getDocumentInfo();
console.log('\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.