We are using these libraries in our code
com.aspose.cells
com.aspose.diagram
com.aspose.slides
com.aspose.words
com.aspose.pdf
Should we require to use a license file in our code for using the production version?
Thanks
Rama
We are using these libraries in our code
com.aspose.cells
com.aspose.diagram
com.aspose.slides
com.aspose.words
com.aspose.pdf
Should we require to use a license file in our code for using the production version?
Thanks
Rama
Yes, you will need to use a license file for the production version of the Aspose libraries you mentioned: com.aspose.cells
, com.aspose.diagram
, com.aspose.slides
, com.aspose.words
, and com.aspose.pdf
.
Using a license file allows you to unlock the full functionality of these libraries and avoid any limitations that may be present in the evaluation mode. To implement the license in your code, you can use the SetLicense
method provided by the Aspose libraries.
Here’s a general example of how to set the license in your code:
import com.aspose.words.License;
public class LicenseExample {
public static void main(String[] args) {
License license = new License();
try {
// Set the license for Aspose.Words
license.setLicense("path/to/Aspose.Words.lic");
// Repeat for other Aspose libraries as needed
} catch (Exception e) {
e.printStackTrace();
}
}
}
Make sure to replace "path/to/Aspose.Words.lic"
with the actual path to your license file. You should do this for each Aspose library you are using in your application.
For more detailed information on licensing, you can refer to the official documentation for each library.
@Rama_Menon
You can refer to the following document to set the license for cells and check if the license is loaded successfully.
Can we use license.setLicense(“Aspose.Total.Java.lic”) instead of separate ones for each software?
@Rama_Menon
Thank you for your feedback. You need to call the License class of each product to set the license for the corresponding product.
The sample code for Aspose.Cells for Java:
com.aspose.cells.License license = new com.aspose.cells.License();
license.setLicense("Aspose.Total.Java.lic");
Hope helps a bit.
You can use a single license file (Aspose.Total.Java.lic
) for all the Aspose Java APIs you mentioned:
Please note, each product still requires that you explicitly set the license in your code for each library, but you can reuse the same license file:
e.g.,
Sample code:
import com.aspose.words.License;
import com.aspose.cells.License;
import com.aspose.pdf.License;
import com.aspose.slides.License;
import com.aspose.diagram.License;
....
License wordsLicense = new com.aspose.words.License();
wordsLicense.setLicense("Aspose.Total.Java.lic");
License cellsLicense = new com.aspose.cells.License();
cellsLicense.setLicense("Aspose.Total.Java.lic");
License pdfLicense = new com.aspose.pdf.License();
pdfLicense.setLicense("Aspose.Total.Java.lic");
License slidesLicense = new com.aspose.slides.License();
slidesLicense.setLicense("Aspose.Total.Java.lic");
License diagramLicense = new com.aspose.diagram.License();
diagramLicense.setLicense("Aspose.Total.Java.lic");
....
// your code goes here.
The key requirement is that you set the license once per library, before using its features/functionality, typically at app startup.
Let us know if you still have any confusion or other queries.