Hi
just testing aspose.pdf.10.4.1.jar for converting pdf. to images.
I always get null pointer error in the xxxDevice.process() function.
(using the same code as on your tutorial: http://www.aspose.com/docs/display/pdfjava/Convert+PDF+Pages+to+JPEG+Image)
The same does happen with all ImageDevices.
I see stackTrace is referenced from those:
org.apache.naming.resources.ImmutableNameNotFoundException (id=487)
org.apache.naming.resources.ImmutableNameNotFoundException (id=6126)
java.lang.NullPointerException (id=6125)
com.aspose.pdf.internal.p348.z72 (id=6121)
…
any idea?
I am successfully using aspose.slides to put together images to a ppt and i wanted also to use aspose to generate those images from pdf…
regards
reto
Hi Reto,
Yes, thanks.
You were just minutes quicker than me.
I was doing this over the weekend. Standalone it’s working.
It was supposed to run inside a tomcat environment. I guess it has some conflict with another library…
do you have any reports on that? or how to nail down the source of the problem?
thanks
reto
Hi Reto,
Would be great if we can find out something.
Here’s part of the error stacktrace:
class com.aspose.pdf.internal.p348.z72: java.lang.NullPointerException —> java.lang.NullPointerException
— End of inner exception stack trace —
com.aspose.pdf.devices.z1.m1(Unknown Source)
com.aspose.pdf.devices.z1.m1(Unknown Source)
com.aspose.pdf.devices.ImageDevice.m1(Unknown Source)
com.aspose.pdf.devices.JpegDevice.processInternal(Unknown Source)
com.aspose.pdf.devices.JpegDevice.process(Unknown Source)
ch.empiricon.common.activepdf.BatchPdfConverter.convertPdfToImagesAspose(BatchPdfConverter.java:193)
just happens in the last line of this code part:
// Create Resolution object
com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(300);
// Create JpegDevice object where second argument indicates the quality of resultant image
com.aspose.pdf.devices.JpegDevice jpegDevice = new com.aspose.pdf.devices.JpegDevice(resolution, 100);
// Convert a particular page and save the image to stream
com.aspose.pdf.Page currp=pdfDocument.getPages().get_Item(pageCount);
jpegDevice.process(currp, imageStream);
Does that help to narrow the search?
Hi Rito,
Now that’s interesting.
I deployed it on the testserver with tomcat 6.0.44 and there it works.
On the machine i developed first, was still tomcat 5.5.25, so seems to be a problem with that version. All the external jars are the same on both machines.
And also java 1.7.0_79 the same.
My machine has Win7-64, on the testserver win2008.
So for me, it’s ok, i can continue my tests with aspose.pdf within tomcat.
Thanks a lot!
(But would still be interesting to know the reason…)
Hi Rito,
Hi Rito,