License class

License class

Provides methods to license the component. To learn more, visit the Licensing and Subscription documentation article.

Constructors

NameDescription
License()Initializes a new instance of this class.

Methods

NameDescription
set_license(license_name)Licenses the component.
set_license(stream)Licenses the component.

Examples

Shows how to initialize a license for Aspose.Words using a license file in the local file system.

import os
import shutil
test_license_file_name = 'Aspose.Total.NET.lic'
# Set the license for our Aspose.Words product by passing the local file system filename of a valid license file.
license_file_name = os.path.join(LICENSE_PATH, test_license_file_name)
license = aw.License()
license.set_license(license_name=license_file_name)
# Create a copy of our license file in the binaries folder of our application.
license_copy_file_name = os.path.join(AssemblyDir, test_license_file_name)
shutil.copy2(license_file_name, license_copy_file_name)
# If we pass a file's name without a path,
# the SetLicense will search several local file system locations for this file.
# One of those locations will be the "bin" folder, which contains a copy of our license file.
license.set_license(license_name=test_license_file_name)

See Also