DocumentInfo Class
Provides common information about a loaded document.
Inheritance Hierarchy
SystemObject
  GroupDocs.Metadata.CommonDocumentInfo

Namespace: GroupDocs.Metadata.Common
Assembly: GroupDocs.Metadata (in GroupDocs.Metadata.dll) Version: 20.9
Syntax
public class DocumentInfo : IDocumentInfo

The DocumentInfo type exposes the following members.

Properties
  NameDescription
Public propertyFileType
Gets the file type of the loaded document.
Public propertyIsEncrypted
Gets a value indicating whether the document is encrypted and requires a password to open.
Public propertyPageCount
Gets the number of pages (slides, worksheets, etc) in the loaded document.
Public propertyPages
Gets a collection of objects representing common information about the document pages (slides, worksheets, etc).
Public propertySize
Gets the size of the loaded document in bytes.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Remarks
Examples
This example demonstrates how to extract basic format information from a file.
C#
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);
    }
}
See Also