Gets the information about the format of the loaded document.
Learn more about getting the document information.
defget_document_info(self):...
Returns: IDocumentInfo: An object that contains detected information such as file type, page count, and size.
Example
importioimportgroupdocs.watermarkasgwwithopen("source.docx","rb")asf:stream=io.BytesIO(f.read())withgw.Watermarker(stream)aswatermarker:info=watermarker.get_document_info()print("File type:",info.file_type)print("Number of pages:",info.page_count)print("Document size:",info.size)