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

Free Support Forum - aspose.com

Licence - Index out of Bounds


When I try to set the licence ( Aspose.Pdf.Kit.xml ) for Aspose.Pdf.Kit, I get the following:

"Index was outside the bounds of the array."
at x88e3d716d9aea406.x2cf87a031823314d.xc99bf7542a430c74(Byte[] x08db3aeabb253cb1)
at x88e3d716d9aea406.x2cf87a031823314d.x98e1674350d747bd(Byte[] x44c8221654ea66c6, Byte[] xfd97c8b131ef865e, Byte[] x1f25abf5fb75e795, Byte[] x8ebde9a98df80374)
at x88e3d716d9aea406.xd402608383e80d3c.x2057a6404e6c2b4c(Byte[] x1f25abf5fb75e795, Byte[] x8ebde9a98df80374)
at x22bcffa34b42a390.x220f433da4115056.x2057a6404e6c2b4c(XmlNode xd4fdffba4cd2bd00, XmlNode x7e15b054ab73fa5b)
at x22bcffa34b42a390.x220f433da4115056.xdd1e20b9c89f40c7(XmlDocument x6beba47238e0ade6)
at x22bcffa34b42a390.x220f433da4115056.x7d0214bf69711dd9(Stream xcf18e5243f8d5fd3)
at x22bcffa34b42a390.x220f433da4115056.x7d0214bf69711dd9(String x1c1fc72fe1a3b4ea, Assembly x5807f920b6fc67c4)
at Aspose.Pdf.Kit.License.SetLicense(String licenseName)
at Aspose.Pdf.Kit.Demos.WinForms.MainForm.Main() in
C:\\Program Files\\Aspose\\Aspose.Pdf.Kit\\Demos\\WinForm\\Aspose.Pdf.Kit.Demos\\MainForm.cs:line 64"

I have tried using the licence file as a stream and a file path with no luck. The error generated above was done using the demonstration code supplied with Aspose PDF Kit. I get the same problem whether using WinForms or Web. Web will be our main development platform.



I am not sure why you are referencing the XML file instead of Lic file while initializing the license for Aspose.Pdf.Kit. Please make sure you are referencing to the correct license file. Use the following code snippets to address the license files.


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



com.aspose.pdf.kit.License lic = new com.aspose.pdf.kit.License();

try {

lic.setLicense(new FileInputStream(new File("Aspose.Custom.Java.lic")));

} catch (Exception e) {




Dim pdfkitlicense As Aspose.Pdf.Kit.License = New Aspose.Pdf.Kit.License


In case the issue still persists, please share the license file so that we can test the issue at our end. Visit the following link for information on How to send a license?

Thank you for the prompt response. It seems that someone in my company has sent me an XML file that was not the licence file. I now have the licence file (Aspose.Pdf.Kit.lic.xml) and all is well. Sorry for the false alarm.