IDocumentInfo
Leave feedback
On this page
Provides common information about a loaded document.
public interface IDocumentInfo
| Name | Description |
|---|---|
| FileType { get; } | Gets the file type of the loaded document. |
| IsEncrypted { get; } | Gets a value indicating whether the document is encrypted and requires a password to open. |
| PageCount { get; } | Gets the number of pages (slides, worksheets, etc) in the loaded document. |
| Pages { get; } | Gets a collection of objects representing common information about the document pages (slides, worksheets, etc). |
| Size { get; } | Gets the size of the loaded document in bytes. |
Learn more
This example demonstrates how to extract basic format information from a file.
using (Metadata metadata = new Metadata(Constants.InputXlsx))
{
if (metadata.FileFormat != FileFormat.Unknown)
{
IDocumentInfo info = metadata.GetDocumentInfo();
Console.WriteLine("File format: {0}", info.FileType.FileFormat);
Console.WriteLine("File extension: {0}", info.FileType.Extension);
Console.WriteLine("MIME Type: {0}", info.FileType.MimeType);
Console.WriteLine("Number of pages: {0}", info.PageCount);
Console.WriteLine("Document size: {0} bytes", info.Size);
Console.WriteLine("Is document encrypted: {0}", info.IsEncrypted);
}
}
- namespace GroupDocs.Metadata.Common
- assembly GroupDocs.Metadata
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.