Get file info
Leave feedback
On this page
With GroupDocs.Comparison you can retrieve the following information about a file:
FileType
represents the document file type (PDF, Word document, Excel spreadsheet, PowerPoint presentation, image etc.).PageCount
represents the number of pages in a document.FileSize
represents the document file size.PagesInfo
represents the page information.
The following code samples show how to get file information:
const comparer = new groupdocs.comparison.Comparer(Constants.SOURCE_WORD);
let info = await comparer.getSource().getDocumentInfo();
console.log(`\nFile type: ${info.getFileType().getFileFormat()}`);
console.log(`Number of pages: ${info.getPageCount()}`);
console.log(`Document size: ${info.getSize()} bytes`);
The result is as follows:
const comparer = new groupdocs.comparison.Comparer(new FileInputStream(Constants.SOURCE_WORD));
let info = await comparer.getSource().getDocumentInfo();
console.log(`\nFile type: ${info.getFileType().getFileFormat()}`);
console.log(`Number of pages: ${info.getPageCount()}`);
console.log(`Document size: ${info.getSize()} 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.