GetInfo
Contents
[
Hide
]
GetInfo(string)
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. |
Return Value
A DocumentInfo with the detected format, page count, and other metadata.
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | Thrown when sourcePath is null or empty. |
| NotSupportedException | Thrown when the file format is not supported. |
Examples
DocumentInfo info = MarkdownConverter.GetInfo("report.docx");
Console.WriteLine($"Format: {info.FileFormat}, Pages: {info.PageCount}, Encrypted: {info.IsEncrypted}");
See Also
- class DocumentInfo
- class MarkdownConverter
- namespace GroupDocs.Markdown
- assembly GroupDocs.Markdown
GetInfo(string, LoadOptions)
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. |
Return Value
A DocumentInfo with the detected format, page count, and other metadata.
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | Thrown when sourcePath is null or empty. |
| NotSupportedException | Thrown when the file format is not supported. |
See Also
- class DocumentInfo
- class LoadOptions
- class MarkdownConverter
- namespace GroupDocs.Markdown
- assembly GroupDocs.Markdown