GetInfo
Leave feedback
On this page
Returns metadata about a document (format, page count, title, author, encryption status) without performing a full conversion. This is a lightweight way to inspect a file.
public static DocumentInfo GetInfo(string sourcePath)
| Parameter | Type | Description |
|---|---|---|
| sourcePath | String | The path to the source document. |
A DocumentInfo with the detected format, page count, and other metadata.
| exception | condition |
|---|---|
| ArgumentNullException | Thrown when sourcePath is null or empty. |
| NotSupportedException | Thrown when the file format is not supported. |
DocumentInfo info = MarkdownConverter.GetInfo("report.docx");
Console.WriteLine($"Format: {info.FileFormat}, Pages: {info.PageCount}, Encrypted: {info.IsEncrypted}");
- class DocumentInfo
- class MarkdownConverter
- namespace GroupDocs.Markdown
- assembly GroupDocs.Markdown
Returns metadata about a document using the specified load options. Use this overload to supply a password when inspecting an encrypted document.
public static DocumentInfo GetInfo(string sourcePath, LoadOptions loadOptions)
| Parameter | Type | Description |
|---|---|---|
| sourcePath | String | The path to the source document. |
| loadOptions | LoadOptions | Options for loading the document (password, format hint). May be null. |
A DocumentInfo with the detected format, page count, and other metadata.
| exception | condition |
|---|---|
| ArgumentNullException | Thrown when sourcePath is null or empty. |
| NotSupportedException | Thrown when the file format is not supported. |
- class DocumentInfo
- class LoadOptions
- class MarkdownConverter
- namespace GroupDocs.Markdown
- assembly GroupDocs.Markdown
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.