Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does the Aspose License object work? Does it last forever?

Tags:

aspose

I'm using Aspose to handle PDFs and Word documents. Each time I'm about to do something with a document, I make sure to call this:

Aspose.Pdf.License pdfLicense = new Aspose.Pdf.License();
pdfLicense.SetLicense("Aspose.Total.lic");

Aspose.Words.License wordLicense = new Aspose.Words.License();
wordLicense.SetLicense("Aspose.Total.lic");

The pdfLicense and wordLicense variables are never used anywhere, yet Aspose correctly recognises that I do have a valid license. How does this happen? Are the licenses being held in a secret singleton somewhere? If so, does this mean they last for the lifetime of the thread?

As this is being used in a web application, if I run the above code when the application starts up, can I then safely use Aspose throughout my application without worrying about the licensing?

At the moment I'd being more paranoid and running that code at the start of every method that uses Aspose. This works fine - my license is recognised correctly - but it's a bit too "programming-by-coincidence" for me to feel comfortable about it.

(I'm using C# with ASP.NET 3.5, if that makes any difference.)

like image 460
teedyay Avatar asked Mar 10 '10 10:03

teedyay


People also ask

How does Aspose license work?

When you buy an Aspose product you get two things: a license and a subscription. The license entitles you to use the software. The subscription entitles you to software updates for a year. The subscription expiry date is stored in the license so when you renew your subscription, you get a new license file.

How do I use Aspose total license?

The easiest way to set a license, is to put the license file in the same folder as that of the dll of the component (included in Aspose. Cells. GridWeb) and specify just the file name without its path. Copy //Instantiate an instance of license and set the license file through its path Aspose.

Is Aspose PDF free to use?

Online PDF converter that allows to convert PDF to PDF, Word, Excel, PowerPoint, HTML and Images. Convert PDF files online for free.

How do I get Aspose license?

Go to My Orders and Quotes. This page lists your order history with Aspose. In the end of column of the grid next to each order is a Review link. Click Review for the order you want to download a license for.


2 Answers

If you read the product documentation, you will see this line:

You need to set a license before performing any operations with documents. It is only required to set a license once per application (or process).

Hence it is process-centric.

like image 109
o.k.w Avatar answered Nov 25 '22 17:11

o.k.w


In the Java version of Aspose you can check if the license was set by calling

License.isLicenseSet();

which returns a boolean. Notice that this is a static method.

like image 34
JonasH Avatar answered Nov 25 '22 18:11

JonasH