License class

License class

Provides methods for applying a license.

The License type exposes the following members:

Constructors

Constructor Description
init Initializes a License instance.

Methods

Method Description
set_license Sets the GroupDocs.Redaction license from a file path.
set_license Sets the GroupDocs.Redaction license from a stream.

Properties

Property Description
is_licensed The property returns True if a valid license has been applied; otherwise, returns False when the component is running in evaluation mode.

Example

import os
from groupdocs.redaction import License

def set_license():
    # Resolve the license path from the environment, with a local fallback
    license_path = os.environ.get("GROUPDOCS_LIC_PATH", "./GroupDocs.Redaction.lic")
    if os.path.exists(license_path):
        License().set_license(license_path)
        print("License set successfully.")
    else:
        print("License file not found. Running in evaluation mode.")

See Also