License class

License class

Provides methods to license the component.

The License type exposes the following members:

Constructors

Constructor Description
init

Methods

Method Description
set_license Licenses the component.
set_license Licenses the component.

Example

import os
from groupdocs.viewer import License

def set_license_from_file():
    license_path = os.path.abspath("./GroupDocs.Viewer.lic")
    if not os.path.exists(license_path):
        print(f"License file not found at: {license_path}")
        return
    license = License()
    license.set_license(license_path)

def set_license_from_stream():
    license_path = os.path.abspath("./GroupDocs.Viewer.lic")
    if not os.path.exists(license_path):
        print(f"License file not found at: {license_path}")
        return
    with open(license_path, "rb") as license_stream:
        license = License()
        license.set_license(license_stream)

Guides

Task guides that use License:

See Also