The license is a plain text XML file that contains details such as the product name, number of developers it is licensed to, subscription expiry date and so on. The file is digitally signed, so don’t modify the file. Even inadvertent adding of an extra line break into the file will invalidate it.
You need to load a license before performing any operations with the control. Make sure you do it before instantiating the EditorControl object. It is only required to set a license once per application or process.
When using Aspose.Editor in a Windows Forms .NET application, you need to use the Aspose.Editor.Desktop.License class to load the license.
When using Aspose.Editor in an ASP.NET application, you need to use the Aspose.Editor.Server.License class to load the license on the server. You do not need to load the license on the client machines where Aspose.Editor runs in the browser as Aspose.Editor.Client uses the licensing status of Aspose.Editor.Server. If the license is loaded on the server, all web clients will be automatically licensed too.
The license can be loaded from a file, stream or an embedded resource. If you specify only the file name without path, Aspose.Editor will try to find the license in the following locations:
- Explicit path.
- The folder that contains the assemblies of your application.
- An embedded resource in the assembly that called Aspose.Editor.Desktop.dll or Aspose.Editor.Server.dll.
Note: Both desktop and client-server controls use the same license.
Note: When using Aspose.Editor.Server control in an ASP.NET application ensure the license file is not accessible by the browser.
Use the License.SetLicense method to license the component. The easiest way to set a license is to put the license file in the Bin folder of your application and specify just the file name without path.
The following example shows how to license the Aspose.Editor.Desktop control:
[C#]
Aspose.Editor.Desktop.License license = new Aspose.Editor.Desktop.License();
license.SetLicense("Aspose.Editor.lic");
[VB.NET]
Dim license As Aspose.Editor.Desktop.License = New Aspose.Editor.Desktop.License
license.SetLicense("Aspose.Editor.lic")
The following example shows how to license the Aspose.Editor.Server control:
[C#]
Aspose.Editor.Server.License license = new Aspose.Editor.Server.License();
license.SetLicense("Aspose.Editor.lic");
[VB.NET]
Dim license As Aspose.Editor.Server.License = New Aspose.Editor.Server.License
license.SetLicense("Aspose.Editor.lic")
The following example shows how to load a license from a stream:
[C#]
Aspose.Editor.Desktop.License license = new Aspose.Editor.Desktop.License();
license.SetLicense(myStream);
[VB.NET]
Dim license As Aspose.Editor.Desktop.License = New Aspose.Editor.Desktop.License
license.SetLicense(myStream)