Licensing

If you want to test Aspose.CAD without evaluation version limitations, request a 30-day temporary license. Please refer to How to get a Temporary License? for more information.

Setting a License

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 do not modify the file; even the inadvertent addition of an extra line break into the file will invalidate it.

You need to set a license before performing any operations with AutoCAD files. You are only required to set a license once per application or process.

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

  1. Explicit path.
  2. The folder that contains the Aspose.CAD.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.CAD.jar and specify just the file name without path as shown in the following example:

Example 1

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

com.aspose.cad.License license = new com.aspose.cad.License();

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

Example 2

Initializes a license from a stream.

com.aspose.cad.License license = new com.aspose.cad.License();

license.setLicense(new java.io.FileInputStream("Aspose.CAD.Java.lic"));

Validate the License

It is possible to validate if the license has been set properly or not. The License class has the isLicensed field that will return true if license has been properly set.

License license = new License();

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

if (License.isLicensed()) {

    System.out.println("License is Set!");

}