Aspose.Pdf.License Error

Hi,

We are using the below code which validate Aspose.Pdf.Licence so that we can use the ASPOSE toolkit to open it.

Aspose.Pdf.License license = new Aspose.Pdf.License();

license.SetLicense("Aspose.Total.lic");

But the licence value always null and lead to Object reference error. The licence value is null when I am using the above code.

Note: I have taken the latest Aspose.pdf dll (7.3.0 Version) from Aspose download and using it in my application.

Also please find the attached screenshot where I am getting licence as null

Thanks,

Karthik N

Hi Karthik,

Thank you for the details.

Please send us your license file by following the steps mentioned in the below link for testing. We will check it and get back to you.

[aspose send license link] (Contact - About - aspose.com)

Sorry for the inconvenience.

Hi Karthik,


Adding more to Nausherwan’s comments, as far as I can understand, you are trying to use the license file as an embedded resource. If so is the case, then I would recommend you to try using the following code lines to initialize the license.

[C#]

// create a Pdf license object
Aspose.Pdf.License lic = new Aspose.Pdf.License();
// specify the license file name along with Default namespace of application
lic.SetLicense(“MergedAPI.Aspose.Total.lic”);
// set the value to indicate that license will be embedded in the application
lic.Embedded =
true;

Where MergedAPI is the default Namespace of my project (Right Click Solution in Solution Explorer
and select Properties. You will see the page with Default Namespace information
).

In case the problem still persists, please share the license file. We are really sorry for this inconvenience.


PS, by the way, from error message it looks like license initialization code could not
find the license file.

hi,

I have sent you the licence file in email. Please review it and reply me in the forum itself.

Thanks,

Karthik n

Hi,

Do you have any other suggestions on this Licence getting null Error.

We are still not able to fix this you.

Thanks in advance,

Karthik N

Hi Karthik,

Thank you for sharing the license file.

I tested your license file and it works fine. Also, after further looking into the details of your reported issue, it looks like you are getting the issue when you are instantiating the License Object. Please share your system environment details i.e. OS, .NET Framework, 32 bit or 64 bit processor etc. and a sample application (without adding the license file) with us to help us reproduce the issue at our end. This will help us test the issue under the same environment to identify the cause of the issue.

We are sorry for the inconvenience.

Hi Karthik,


Adding more to Nausherwan’s comments, I have also tested the scenario over Windows 7 X64 Enterprise edition where I have used VisualStudio 2010 Professional project with .NET Framework 4.0 as target platform and as per my observations, I am unable to notice any problem.

Hi Karthik,

We have tested the issue over Windows Server 2008 R2 as well but we were unable to reproduce the issue. As requested before, please share your sample application with us to help us reproduce the issue at our end.

Sorry for the inconvenience,