Get document info

Use GetDocumentInfo() or the static GetInfo() method to retrieve document metadata without performing a full conversion. This is useful for building file browsers, validation pipelines, and pre-conversion UIs.

Using static method

using GroupDocs.Markdown;

DocumentInfo info = MarkdownConverter.GetInfo("business-plan.docx");

Console.WriteLine($"Format:    {info.FileFormat}");    // Docx
Console.WriteLine($"Pages:     {info.PageCount}");     // 42
Console.WriteLine($"Title:     {info.Title}");         // "Q3 Report"
Console.WriteLine($"Author:    {info.Author}");        // "Jane Doe"
Console.WriteLine($"Encrypted: {info.IsEncrypted}");   // false

business-plan.docx is a sample file used in this example. Click here to download it.

Format:    Docx
Pages:     5
Title:     Meridian Outdoor Co. - Business Plan
Author:    Meridian Outdoor Co.
Encrypted: False

Download full output

Using instance method

using GroupDocs.Markdown;

using var converter = new MarkdownConverter("cost-analysis.xlsx");
DocumentInfo info = converter.GetDocumentInfo();

Console.WriteLine($"Format:    {info.FileFormat}");
Console.WriteLine($"Pages:     {info.PageCount}");
Console.WriteLine($"Title:     {info.Title}");
Console.WriteLine($"Author:    {info.Author}");
Console.WriteLine($"Encrypted: {info.IsEncrypted}");

cost-analysis.xlsx is a sample file used in this example. Click here to download it.

Format:    Xlsx
Pages:     4
Title:     
Author:    
Encrypted: False

Download full output

DocumentInfo properties

PropertyTypeDescription
FileFormatFileFormatDetected file format (e.g., FileFormat.Docx)
PageCountintNumber of pages or worksheets
TitlestringDocument title from metadata
AuthorstringDocument author from metadata
IsEncryptedboolWhether the document is password-protected