fromgroupdocs.redactionimportRedactortry:withRedactor(r"C:\Temp\testfile.doc")asred:doc_info=red.get_document_info()print(f"Document size: {doc_info.size}")print(f"Document format: {doc_info.file_type.file_format}")print(f"Document contains {doc_info.page_count} pages")forpageindoc_info.pages:print(f"Page {page.page_number} size is {page.width}x{page.height}")exceptGroupDocs.Redaction.Exceptions.PasswordRequiredException:print("You are trying to access document which is password protected. Please, set the password.")exceptGroupDocs.Redaction.Exceptions.IncorrectPasswordException:print("The provided password is not valid.")