Get file info
Leave feedback
On this page
GroupDocs.Comparison allows you to get the following file information:
- FileType represents the document file type (PDF, Word document, Excel spreadsheet, PowerPoint presentation or image etc.).
- PageCount represents count of document pages.
- FileSize represents the document file size.
- PagesInfo represents the page information.
The following code samples show how to get file information:
using (Comparer comparer = new Comparer("source.docx"))
{
IDocumentInfo info = comparer.Source.GetDocumentInfo();
for (int i = 0; i < info.PageCount; i++)
{
Console.WriteLine("\nPage number: {5}\nFile type: {0}\nNumber of pages: {1}\nDocument size: {2} bytes\nWidth: {3}\nHeight: {4} ",
info.FileType, info.PageCount, info.Size, info.PagesInfo[i].Width, info.PagesInfo[i].Height, i + 1);
}
}
The result is as follows:
using (Comparer comparer = new Comparer(File.OpenRead("source.docx"))
{
IDocumentInfo info = comparer.Source.GetDocumentInfo();
for (int i = 0; i < info.PageCount; i++)
{
Console.WriteLine("\nPage number: {5}\nFile type: {0}\nNumber of pages: {1}\nDocument size: {2} bytes\nWidth: {3}\nHeight: {4} ",
info.FileType, info.PageCount, info.Size, info.PagesInfo[i].Width, info.PagesInfo[i].Height, i + 1);
}
}
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.