We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Set License error - Aspose PDF

Hello,

We use Aspose PDF 3.5.0.0 on one of the web services . License loading and everything is running fine from a month after we deployed it on 64 bit machine. However today it suddenly start giving the set license error. it maybe traffic related but we want to resolve this issue as quickly as possible.

The code for loading the license file (Aspose.Pdf.lic) in the asmx web service is as follows :-

protected Aspose.Pdf.License _AsposeLicense;
_AsposeLicense = new Aspose.Pdf.License();
_AsposeLicense.SetLicense(“Aspose.Pdf.lic”);


------------
------------
-------------

Can you please give some info as to how it can be resolved.

Thanks,
Harshal



Hello Harshal,

Thanks for using our products.

Can you please share some details regarding the error message that you are getting ? More along, can you please try using the latest release version as certain license related issues have been fixed in new release versions.

With latest versions, when using the license file as an embedded resource, please try using the following code line along with license setting code.

[C#]

Aspose.Pdf.License pdflic = new Aspose.Pdf.License();
pdflic.SetLicense("WindowsTemplate.Aspose.Total.lic");
pdflic.Embedded = true;

Where WindowsTemplate is the Default namespace of my solution. We are really sorry for this inconvenience.

We would prefer to get this issue resolved with the current version if it’s possible.

Here’s the detail of the error message we get :-

<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:DoNotOptimizeForBrowser/>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–>

System.NullReferenceException: Object reference not set to an instance of an object.

at Aspose.Pdf..(Stream ֒)

at Aspose.Pdf..(String , Assembly )

at Aspose.Pdf.License.SetLicense(String licenseName)

<span style=“font-size:11.0pt;font-family:“Calibri”,“sans-serif”;mso-ascii-theme-font:
minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;
mso-hansi-theme-font:minor-latin;mso-bidi-font-family:“Times New Roman”;
mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>

Hello Harshal,

Thanks for sharing the information.

Can you please share some code snippet/sample project that can help us in replicating this issue at our end ? More along, please share some details regarding your working environment i.e. Operating System version, .NET Framework version, previous operating system version (over which product worked correctly) and either it was 32bit or 64bit.

We are really sorry for this inconvenience.

Info :-

.NET version 2.0
Windows Server 2008 R2 data center edition 64 bit
Aspose pdf tool used on the asmx web service do some some internal processing of pdf.

All we are doing in the code is every time the request to the web service method is made :- we are loading the license.

Here’s a sample method :-

[Webmethod]
public Method(string pdfpath)
{
protected Aspose.Pdf.License _AsposeLicense;
_AsposeLicense = new Aspose.Pdf.License();
_AsposeLicense.SetLicense(“Aspose.Pdf.lic”);
}

The license error cannot be reproduced during the normal operation. But I am suspecting it occurs when simultaneously many processes are calling the web method …We can’t restrict the number of call as that depends on the traffic of our website which is the client of this web service.This issue also occurred using the same product on 32 bit Windows server 2003 r2 edition also .

Thanks,
Harshal


Hello Harshal,

Thanks for your patience. We are working over this query and will get back to you soon. We apologize for your inconvenience.

Hello,

Is there any updates on the above thing ?

Thanks,
Harshal

Hello Harshal,

Thanks for your patience.

I am afraid we are still unable to replicate this problem in a simple web application using latest release version. Can you please try using the latest release version ? In fact in recent versions, some of the issues related to Licensing have been fixed. Nevertheless, we will try to reproduce it in our environment. We are really sorry for this inconvenience.

Hello Harshal,

I am not entirely certain about the expiry date of your license file. Can you please share this information as it will help us in identifying Aspose.Pdf release version which can be supported with your license file. We apologize for your inconvenience.

Please do not attach the license file or license file contents in forums. In case you need to share the license file, please visit the following link for information on How to send a license?

Hi Nayyer,

As far as possible we would avoid any upgrades and like to stick to the current version of Aspose pdf since it has been working great for us except the above issue.

The license has not expired for sure since this issue happens only intermittently. To give more hint about when it happens :- It happens when the traffic on the site increases or let’s say the images that it has to manipulate are very large, or just guessing , can it be related to multi-threading ? i.e simultaenously the web service is called by many clients and each thread of the web service tries to read that same licenses file and fail ?

Thanks,
Harshal




Hello Harshal,

Thanks for sharing the details.

We have tried replicating the issue at our end but as per our observations, the problem is not occurring when using latest release version of Aspose.Pdf for .NET 5.3.0. The version that you are using is quite old and there have been numerous improvements in terms of licensing and other features in recent release versions.

Can you please try using the latest version without using the license file and see if it does not create any formatting issues. Once you are certain that no formatting issues are occurring, you may try upgrading the license file. In case you have any further query, please feel free to contact. We apologize for your inconvenience.

Can I use the Aspose PDF for .NET 6.0.0 the one which came on July 1st ?

Hello Harshal,

If your subscription is valid to receive free upgrades till 01Jul2011, you can use the new Aspose.Pdf for .NET 6.0.0 (Merged API). Please try using it and in case you encounter any problem or you have any further query, please feel free to contact.

Hello,

I am experiencing the same situation with Aspose.Words 9.0, using the same .Net version and OS as described above, and also in a class used by a web service ASMX.

Has a solution been found yet?

Thank you.