get_document_info method

get_document_info

Retrieves the general information about the document, such as size and page count.

def get_document_info(self):
    ...

Returns: IDocumentInfo: General document information.

Raises Description
PasswordRequiredException Raised when the document is password protected.
IncorrectPasswordException Raised when an invalid password is provided.

Example

from groupdocs.redaction import Redactor

with Redactor("./sample.docx") as redactor:
    info = redactor.get_document_info()
    print(f"File type: {info.file_type}")
    print(f"Number of pages: {info.page_count}")
    print(f"Document size: {info.size} bytes")

See Also