DocumentInfo class

DocumentInfo class

The base implementation for retrieving polymorphic document information.

Instances are returned by Converter.get_document_info() and expose metadata such as format, page count, creation date, size, and format‑specific attributes.

The DocumentInfo type exposes the following members:

Methods

Method Description
get
get_file
get_string

Properties

Property Description
creation_date The creation date of the document.
format The format of the document.
pages_count The total number of pages in the document.
property_names The property implements IDocumentInfo.property_names.
size The size of the document in bytes.

Example

from groupdocs.conversion import Converter

def show_document_info(path):
    with Converter(path) as converter:
        info = converter.get_document_info()
        print("Format:", info.format)
        print("Pages count:", info.pages_count)
        print("Creation date:", info.creation_date)
        print("Size (bytes):", info.size)

# Example usage
show_document_info("./lorem-ipsum.txt")

See Also