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

Free Support Forum - aspose.com

Apose.Pdf 4.2.1 null key exception

I am attempting to use Aspose.Pdf 4.2.1 to create a thumbnail for a PDF file. I am developing on Mac OS X 10.8.5 and Java 7.

When I run the following code:
//open document
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(resourcePath);

if (pdfDocument.getPages().size() > 0) {
// create stream object to save the output image
OutputStream imageStream = new FileOutputStream(convertedPath);

//create Resolution object
Resolution resolution = new Resolution(300);
//create PngDevice object with particular resolution
PngDevice pngDevice = new PngDevice(resolution);
//convert a particular page and save the image to stream
Page page1 = pdfDocument.getPages().get_Item(1);
pngDevice.process(page1, imageStream);

//close the stream

I end up with this exception stack trace:
class com.aspose.ms.System.e: null key
Parameter name: key
com.aspose.ms.System.a.f.get_Item(Unknown Source)
com.aspose.pdf.a.b.e.b.d.a(Unknown Source)
com.aspose.pdf.a.e.a.a(Unknown Source)
com.aspose.pdf.a.j.b.g.a(Unknown Source)
com.aspose.pdf.a.j.h.a(Unknown Source)
com.aspose.pdf.Z.a(Unknown Source)
com.aspose.pdf.ImageDevice.a(Unknown Source)
com.aspose.pdf.PngDevice.processInternal(Unknown Source)
com.aspose.pdf.PngDevice.process(Unknown Source)

I have seen similar issues to this on the forum but were marked as resolved in 4.1.0 and other recent versions. I am able to use PDF Renderer to do the same conversion on the PDF file but would like to use Aspose instead.

Thanks in advance for any help with this.


Hi Andrew,

Thanks for contacting support and sorry for the delayed response.

We are working over this query and will get back to you soon.

Hi Andrew,

Thanks for your patience.

I have tested the scenario while using Aspose.Pdf for Java 4.2.1 over MAC OS X 10.8.2 and have observed that when using this component in trail/evaluation mode, an exception is being generated. For
the sake of correction, I have logged it in our issue tracking system as PDFNEWJAVA-33752 . We
will investigate this issue in details and will keep you updated on the status
of a correction.

We apologize for your inconvenience.

Therefore in n order to use our component without these issues, please try requesting a 30 days temporary license. For further details, please visit Get a temporary license.

Hi Andrew,

Thanks for your patience. Please note your above reported issue (PDFNEWJAVA-33752) has been fixed in Aspose.Pdf for Java 9.7.0 in result of some other fix. Please download and try latest version of Aspose.Pdf for Java it will help you to accomplish the task.

Please feel free to contact us for any further assistance.

Best Regards,