Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
You can install and try Aspose.SVG for .NET before applying a license. For applications that must produce unrestricted SVG, PDF, XPS, or image output, apply a license before processing documents.
The evaluation version is available from the Aspose.SVG for .NET downloads page. Without a license, the current product limitations are:
To test Aspose.SVG without evaluation limitations, request a 30-day temporary license.
| Scenario | Method |
|---|---|
| Store a license alongside application deployment files | Load a license file with License.SetLicense(string) |
| Read a license from application storage or configuration infrastructure | Load a stream with License.SetLicense(Stream) |
| Ship the license inside an application assembly | Set the license file as an embedded resource and load it by name |
| Use consumption-based licensing | Apply public and private keys with Metered.SetMeteredKey() |
Apply the license once during application startup, before creating, loading, converting, or saving SVG documents.
The Aspose.Svg.License class accepts a full path or a short file name. When a short name is provided, SetLicense() searches for the license in the following locations:
The following example loads an Aspose.SVG.lic file available to the application:
1using Aspose.Svg;
2
3// Create an Aspose.SVG license object.
4License license = new License();
5
6// Apply a license stored as an application file.
7license.SetLicense("Aspose.SVG.lic");If your solution uses more than one Aspose product, instantiate the license class for the product being licensed. For Aspose.SVG, use Aspose.Svg.License.
Use the stream overload when your application obtains the license from a protected file location, embedded configuration, or another storage provider.
1using System.IO;
2using Aspose.Svg;
3
4// Initialize an Aspose.SVG license object.
5License license = new License();
6
7// Open a stream that contains the license data.
8using (FileStream stream = new FileStream("Aspose.SVG.lic", FileMode.Open))
9{
10 // Apply the license from the stream.
11 license.SetLicense(stream);
12}Embedding a license can be convenient when the application is distributed as a single deployment unit.
.lic file to your project.SetLicense().1using Aspose.Svg;
2
3// Create an Aspose.SVG license object.
4License license = new License();
5
6// Resolve and apply the license from the embedded resource name.
7license.SetLicense("Aspose.SVG.lic");The License class looks for an embedded resource in the calling assembly when resolving the supplied license name.
Metered licensing uses public and private keys instead of a .lic file. It is intended for usage-based licensing scenarios; see the
Metered Licensing FAQ for purchasing and billing information.
Use the Aspose.Svg.Metered class to set your metered keys during application startup:
1using Aspose.Svg;
2
3// Create a metered license object.
4Metered metered = new Metered();
5
6// Apply the purchased public and private metered keys.
7metered.SetMeteredKey("public-key", "private-key");The metered API also provides methods to check licensing state and consumption:
1// Check whether metered licensing is currently active.
2bool isLicensed = Metered.IsMeteredLicensed();
3
4// Read the current consumption quantity and credit.
5decimal consumedQuantity = Metered.GetConsumptionQuantity();
6decimal consumedCredit = Metered.GetConsumptionCredit();A metered application must be able to report consumption data. The Metered API reference explains behavior when consumption data cannot be uploaded.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.