PdfViewInfo class

PdfViewInfo class

Represents view information for a PDF document.

The PdfViewInfo type exposes the following members:

Constructors

Constructor Description
init Initializes a new PdfViewInfo instance.
init Initializes a new PdfViewInfo instance.

Methods

Method Description
to_string Returns a string that represents the current object. (inherited from ViewInfo)

Properties

Property Description
printing_allowed The printing_allowed property indicates whether printing of the document is allowed.
file_type The type of the file. (inherited from ViewInfo)
pages The list of pages to view. (inherited from ViewInfo)

Example

from typing import cast
from groupdocs.viewer import Viewer
from groupdocs.viewer.options import ViewInfoOptions
from groupdocs.viewer.results import PdfViewInfo

def get_pdf_info():
    with Viewer("sample.pdf") as viewer:
        info = viewer.get_view_info(ViewInfoOptions.for_html_view())
        pdf_info = cast(PdfViewInfo, info)

        print("File type:", pdf_info.file_type)
        print("Pages count:", len(pdf_info.pages))
        print("Printing allowed:", pdf_info.printing_allowed)

if __name__ == "__main__":
    get_pdf_info()

Guides

Task guides that use PdfViewInfo:

See Also