Licensing
Evaluation Version Limitations
Customers can test the API thoroughly before making a final decision to buy it. However, the API has certain evaluation limitations if you will use it without a license. These limitations include:
- The number of drawing operations is limited to 100 and an exception will be thrown after that
- A watermark is embedded in output image when user saves the image
Apply License using File or Stream Object
The license can be loaded from a file or stream object. The easiest way to set a license is to put the license file in the same folder as the Aspose.Drawing.dll/Aspose.Drawing.Common.dll file and specify the file name, without a path, as shown in the example below.
Loading a License from File
The easiest way to apply a license is to put the license file in the same folder as the Aspose.Drawing.dll/Aspose.Drawing.Common.dll file and specify just the file name without a path.
// For complete examples and data files, please go to https://github.com/aspose-drawing/Aspose.Drawing-for-.NET | |
// Initialize license object | |
System.Drawing.AsposeDrawing.License license = new System.Drawing.AsposeDrawing.License(); // For Aspose.Drawing package. | |
// Aspose.Drawing.License license = new Aspose.Drawing.License(); // For Aspose.Drawing.Common package. | |
// Set license | |
license.SetLicense("Aspose.Drawing.lic"); | |
System.Console.WriteLine("License set successfully."); |
Loading a License from a Stream Object
The following example shows how to load a license from a stream.
// For complete examples and data files, please go to https://github.com/aspose-drawing/Aspose.Drawing-for-.NET | |
using System; | |
using System.IO; | |
// Initialize license object | |
System.Drawing.AsposeDrawing.License license = new System.Drawing.AsposeDrawing.License(); // For Aspose.Drawing package. | |
// Aspose.Drawing.License license = new Aspose.Drawing.License(); // For Aspose.Drawing.Common package. | |
// Load license in FileStream | |
FileStream myStream = new FileStream("Aspose.Drawing.lic", FileMode.Open); | |
// Set license | |
license.SetLicense(myStream); | |
Console.WriteLine("License set successfully."); |
Metered License
Aspose.Drawing allows developers to apply metered key. It is a new licensing mechanism. The new licensing mechanism will be used along with existing licensing method. Those customers who want to be billed based on the usage of the API features can use the metered licensing. For more details, please refer to Metered Licensing FAQ section.
A new class Metered has been introduced to apply metered key. Following is the sample code demonstrating how to set metered public and private keys.
// For complete examples and data files, please go to https://github.com/aspose-drawing/Aspose.Drawing-for-.NET | |
// Initialize metered object | |
System.Drawing.AsposeDrawing.Metered metered = new System.Drawing.AsposeDrawing.Metered(); // For Aspose.Drawing package. | |
// Aspose.Drawing.Metered metered = new Aspose.Drawing.Metered(); // For Aspose.Drawing.Common package. | |
// Set metered public and private keys | |
metered.SetMeteredKey("*****", "*****"); |