Get document info

Get document information

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("report.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

Using instance method

using GroupDocs.Markdown;

using var converter = new MarkdownConverter("spreadsheet.xlsx");
DocumentInfo info = converter.GetDocumentInfo();

Console.WriteLine($"Worksheets: {info.PageCount}");
Console.WriteLine($"Title: {info.Title}");

// Decide based on metadata
if (info.PageCount > 100)
{
    Console.WriteLine("Large document — consider using PageNumbers.");
}

ConvertResult result = converter.Convert();
Console.WriteLine(result.Content);

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