Free Support Forum - aspose.com

How to apply license for Aspose.Total for .Net


#1

How do we apply license for Aspose.Total for .Net

We are using Aspose.Words & Aspose.Cells. I understand that I have to apply license once per domain, so probably I’ll do it application’s global.ascx file.

Do I need to call SetLicense() method for both Aspose.Cells.License and Aspose.Words.License individually?

or is there any separate API to set license for Aspose.Total so we don’t have to set license for each individual product inside it?


#2

Hi,


Thanks for your inquiry. I am representative of Aspose.Words team. There is no such separate API to set license for Aspose.Total; you have to set a license separately for each Aspose product you are using. For example, if you are using Aspose.Words and Aspose.Cells, code for setting the license will look like this:

Aspose.Words.License awLic = new Aspose.Words.License();u1:p</u1:p><o:p></o:p>

awLic.SetLicense(“Aspose.Total.lic”);


Aspose.Cells.License cellsLicense = new Aspose.Cells.License();<o:p></o:p>

cellsLicense.SetLicense(“Aspose.Total.lic”);


If we can help you with anything else, please feel free to ask.

Best Regards,

#3

Thanks for your quick reply. We just received the actual license for Aspose.Total. I have couple questions

1> is there separate download for licensed Aspose.Total or the one listed in download section can be used?
2> Do we get special support as licensed user or this forum is the only source of support for us?

#4

Hi,


1) No, there is no separate downloads for the products, you will use the same binaries/assemblies from the download section. Actually, if you do not use / set a valid license(s) (for the products), by default, the products will be used in evaluation mode with limitations. When, you use and set the license (in code), the products will become professional versions or licensed versions.

2) Well, we always give importance to the licensed customers for their queries and issues. The best support our customer can get is to use via our forums which is quick. Also, if you need more attention and want your issues should be fixed (or new requirements are also fulfilled soon) and your queries should be handled on priority basis, you may consider purchasing Priority support, Enterprise support or even Sponsored support. Please see the page on what types of support we offer at the moment:
http://www.aspose.com/corporate/services/default.aspx


#5

Hi Hafeez,

Thank you for your reply but I still dont understnd where to put the code you have provided. Whether this code to be put i my .net application or should I createn new text document and keep it in my application folder.

Could you kindly revert with nmore details [Process].


#6
The way i would do it is by including .lic file as embedded resource in your application. ( i would include it in application's framework) then put the code above at the start of your application.

For example
if its service or web site the put the code in global file in application start event.


#7

Hi Nitin,


Thanks for your interest in Aspose products.

You need to set the license before using any other Aspose.Words classes. You can keep this code within your .NET application. In case you are developing a Windows Forms or console application, call License.SetLicense in your startup code, before using Aspose.Words classes. When developing an ASP.NET application, you can call License.SetLicense from the Global.asax.cs (Global.asax.vb) file, in the Application_Start protected method. It is called once when the application starts. Do not call License.SetLicense from within Page_Load methods since it means the license will be loaded every time a web page is loaded. I hope, this helps.

Best regards,

#8

Hello,

I assume the need to apply the “Total License” to each product is applicable to the other “Aspose Total” platforms as well. Correct?

This wasn’t clear in the trial license email:
" Note: If you have bought Aspose.Total for .NET, Java, Android, SharePoint, Reporting Services or JasperReports then your license file will work with all .NET, Java, Android, SharePoint, Reporting Services or JasperReports products respectively."

It only says “will work”, it would be clearer to also indicate it needs to be applied to each product individually.

Also, it would be helpful to show how to “check” each product is licensed. I’m currently digging through the API docs for each product. For example Cells uses a static method on the cells License class, but Words uses a method on a word license object:

  • com.aspose.cells.License.isLicenseSet()
  • myWordLicense.isLicensed()

BTW - We’re using the Java platform.

Cheers,
Erik


#9

@ewestland,
Thanks for your query.

If you use several Aspose products in an application, for example Aspose.Words and Aspose.Cells, here are few useful tips.

  • Set the license for each Aspose product separately. Even if you have a single license file for all components, for example ‘Aspose.Total.Java.lic’, you still need to call the License.setLicense method separately for each Aspose product.

  • Use fully qualified License class name. Each Aspose product has a License class in its namespace. For example, Aspose.Words has com.aspose.words.License and Aspose.Cells has com.aspose.cells.License class. Using the fully qualified class name allows you to avoid any confusion about which license is applied to which product.


#10

Thanks for the quick response.

It couldn’t locate license checks for the barcode and pdf products, so I assume the “setLicense()” calls throw an exception if there’s something wrong.

try {
  licenseCells.setLicense(appClass.getClass().getResourceAsStream("/licenses/Aspose.Total.Java.lic"));
  licenseWord.setLicense(appClass.getClass().getResourceAsStream("/licenses/Aspose.Total.Java.lic"));
  licensePdf.setLicense(appClass.getClass().getResourceAsStream("/licenses/Aspose.Total.Java.lic"));
  // ...  
  logger.info("Aspose Total is fully licensed");
}
catch (Exception e)  {
  logger.error("Aspose Total is NOT fully licensed", e);
}

Cheers,
Erik


#11

@ewestland

Would you please elaborate a little more about the issue you are currently facing. Are you able to set the license for other APIs but not for Aspose.PDF and Aspose.Barcode API. You may validate license as explained in documentation articles below:

Please share stack trace if any exception is thrown so that we may investigate the scenario further and assist you accordingly.


#12

Sorry I wasn’t clear, but I am NOT having issues (re)loading the license file for each product.

My intent was to highlight (for other customers) that you can’t check license validity the same way across products, so they wouldn’t hunt through the API docs like I did. :wink:

How I’m checking now:
com.aspose.words.License myWordsLicense = new com.aspose.words.License();

boolean isFullyLicensed =
myWordsLicense.isLicensed() &&
com.aspose.cells.License.isLicenseSet() &&
com.aspose.pdf.Document.isLicensed() && com.aspose.barcode.generation.BarCodeGenerator.isLicensed();

Cheers,
Erik


#13

@ewestland

Thank you for your valuable feedback.

We are glad to know that you are not facing any issue while working with the APIs. We have recorded your feedback and we will internally look into the possibilities to check license validity the same way across all products.

Please keep using our API and in event of any further query, feel free to ask.