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();
}
sample.docx is the sample file used in this example. Click here to download it.
File type: Microsoft Word Open XML Document (.docx)
Number of pages: 1
Document size: 19370 bytes
const redaction = require('@groupdocs/groupdocs.redaction');
const java = require('java');
const FileInputStream = java.import('java.io.FileInputStream');
const stream = new FileInputStream('sample.docx');
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();
stream.close();
}
sample.docx is the sample file used in this example. Click here to download it.
File type: Microsoft Word Open XML Document (.docx)
Number of pages: 1
Document size: 19370 bytes
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.