Licence init for all?

Is there a way to init all API without instanciating Licence class of every API for time efficiency?
Something like:

TotalLicence licence= new TotalLicence("path");
initPdf (licence);
initDoc (licence); ......

@Sayah.Mnafeg,

No, there is no way to initialize all Aspose APIs at once in your desired approach, and you need to instantiate the License class for each individual API and set it in the code accordingly. However, since the licensing code is only required and processed once in the entire application lifecycle, you should place the licensing code where it needs to be processed first and only once. There is no need to process the licensing code multiple times.

i use 10 API (pdf, mail…). Is there a way to optimize the time of licences initialization ? thanks

@Sayah.Mnafeg,

Could you give us details which particular Aspose APIs are taking more time for license initializations? Also, give us your sample code that you are using to instantiate and set the license for different APIs. We will check it soon.

String licence = "<?xml version=\"1.0\"?>\r\n<License>\r\n  <Data>\r\n....... "; 
// note 
com.aspose.note.License licenseNote = new com.aspose.note.License();
licenseNote.setLicense( new ByteArrayInputStream(licence.getBytes()));
// word
com.aspose.words.License licenseWord = new com.aspose.words.License();
licenseWord.setLicense( new ByteArrayInputStream(licence.getBytes()));

the same is for the followings
// task
// slides
// mails
// images
// cells
// pdf
// html
// diagram
// ocr

@Sayah.Mnafeg,

Which versions of the Aspose for Java APIs are you using? It is recommended to use the latest versions of the APIs. Could you please share the time (cost) taken by each API to load and set the license? This way, we can evaluate and determine if the time is normal or if it requires improvements for the licensing module.