Tries to find the license in the following locations:
Explicit path.
The folder that contains the GroupDocs component assembly.
The folder that contains the client’s calling assembly.
The folder that contains the entry (startup) assembly.
An embedded resource in the client’s calling assembly.
defset_license(self,license_name):...
Parameter
Type
Description
license_name
str
Can be a full or short file name or name of an embedded resource. Use an empty string to switch to evaluation mode.
Example
importosfromgroupdocs.assemblyimportLicensedefset_license_from_stream():# Resolve the license path from the environment, with a local fallbacklicense_path=os.environ.get("GROUPDOCS_LIC_PATH","./GroupDocs.Assembly.lic")ifos.path.exists(license_path):withopen(license_path,"rb")asstream:License().set_license(stream)print("License set successfully.")else:print("License file not found. Running in evaluation mode.")
set_license
Licenses the component.
Use this method to load a license from a stream.
defset_license(self,stream):...
Parameter
Type
Description
stream
io.RawIOBase
A stream that contains the license.
Example
importosfromgroupdocs.assemblyimportLicenselicense_path=os.getenv("GROUPDOCS_LIC_PATH","./GroupDocs.Assembly.lic")ifos.path.exists(license_path):withopen(license_path,"rb")asstream:License().set_license(stream)print("License set successfully.")else:print("License file not found. Running in evaluation mode.")
Aliases
These names call set_license too, limited to the overloads listed.