Get document info

GroupDocs.Parser provides the functionality to get the basic document info by the GetDocumentInfo method:

IDocumentInfo GetDocumentInfo();

IDocumentInfo interface has the following members:

MemberDescription
FileTypeThe document type.
PageCountThe total number of document pages.
SizeThe size of the document in bytes.

Here are the steps to get document info:

The following example shows how to get document info:

// Create an instance of Parser class
using(Parser parser = new Parser(filePath))
{
    // Get the document info
    IDocumentInfo info = parser.GetDocumentInfo();

    Console.WriteLine(string.Format("FileType: {0}", info.FileType));
    Console.WriteLine(string.Format("PageCount: {0}", info.PageCount));
    Console.WriteLine(string.Format("Size: {0}", info.Size));
}

More resources

Advanced usage topics

To learn more about document data extraction features and get familiar how to extract text, images, forms and more, please refer to the advanced usage section.

GitHub examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free online document parser App

Along with full featured .NET library we provide simple, but powerful free Apps.

You are welcome to extract data from PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, Emails and more with our free online Free Online Document Parser App.