Aspose.Words

Applying a License

Once you are happy with your evaluation of Aspose.Words, you can purchase a license at the Aspose website http://www.aspose.com/Purchase/Components/Default.aspx. Make yourself familiar with the different subscription types offered. If you have any questions, do not hesitate to contact the Aspose sales team.

Every Aspose license carries a one-year subscription for free upgrades to any new versions or fixes that come out during this time. Technical support is free and unlimited and provided both to licensed and evaluation users.

The license is a plain text XML file that contains details such as the product name, number of licensed developers, subscription expiry date and so on. The file is digitally signed, so do not modify the file; even the inadvertent adding of an extra line break into the file will invalidate it.

You need to set a license before performing any operations with documents. Make sure you do this before creating a Document object. You are only required to set a license once per application or process.

Loading the license file

The license can be loaded from a stream or file in the following locations:

1.       Explicit path.

2.       The folder that contains the Aspose.Words.jar.

3.       The folder that contains the assembly that called Aspose.Words.jar

Use the License.SetLicense method to license the component. Often the easiest way to set a license is to put the license file in the same folder as Aspose.Words.jar and specify just the file name without path as shown in the following example:

Example LicenseFromFileNoPath

In this example Aspose.Words will attempt to find the license file in folders that contain the JARs of your application.

[Java]

 

License license = new License();

license.setLicense("Aspose.Words.Java.lic");

 

 

Example LicenseFromStream

Initializes a license from a stream.

[Java]

 

License license = new License();

license.setLicense(myStream);