Retrieves general information about the document, such as size and page count.
defget_document_info(self):...
Returns: IDocumentInfo: An object containing document size, file type, page count, and page details.
Raises
Description
PasswordRequiredException
If the document is password protected.
IncorrectPasswordException
If an invalid password is provided.
Example
fromgroupdocs.redactionimportRedactordefget_local_file_info():# Load the document from local diskwithRedactor("./sample.docx")asredactor: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")