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.)
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.
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.
Online PDF converter that allows to convert PDF to PDF, Word, Excel, PowerPoint, HTML and Images. Convert PDF files online for free.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With