IDocumentInfo class

IDocumentInfo class

Provides methods required for retrieving basic document information.

Learn more

The IDocumentInfo type exposes the following members:

Properties

Property Description
file_type The file format description.
is_encrypted The document is encrypted and requires a password to open; returns True if encrypted, otherwise False.
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}")
    print(f"Document contains {doc_info.page_count} pages")

See Also