Get document info
Leave feedback
On this page
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 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
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
| Property | Type | Description |
|---|---|---|
FileFormat | FileFormat | Detected file format (e.g., FileFormat.Docx) |
PageCount | int | Number of pages or worksheets |
Title | string | Document title from metadata |
Author | string | Document author from metadata |
IsEncrypted | bool | Whether the document is password-protected |
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.