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
setLicense(licenseName)Licenses the component.
setLicense(stream)Licenses the component.

Examples

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

// Set the license for our Aspose.Words product by passing the local file system filename of a valid license file.
const licFilename = "Aspose.Words.NodeJs.NET.lic";
var licenseFileName =  path.join(base.licenseDir, licFilename);

let license = new aw.License();
try {
  license.setLicense(licenseFileName);

  // Create a copy of our license file in the binaries folder of our application.
  var licenseCopyFileName = path.join(base.codeBaseDir, licFilename);
  fs.copyFileSync(licenseFileName, licenseCopyFileName);

  // 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.setLicense(licFilename);

See Also