IDocumentInfo class

IDocumentInfo class

Provides methods required for retrieving basic document information.

Learn more: Get document info.

The IDocumentInfo type exposes the following members:

Properties

Property Description
file_type The file format description.
is_encrypted The property indicates whether the document is encrypted and requires a password to open.
page_count The total page count.
pages The collection of document pages descriptions.
size The document size in bytes.

Example

from groupdocs.watermark import Watermarker

with Watermarker(r"D:\input.pdf") as watermarker:
    doc_info = watermarker.get_document_info()
    print(f"Document size: {doc_info.size}")
    print(f"Document format: {doc_info.file_type.file_format_name}")
    print(f"Document contains {doc_info.page_count} pages")

See Also