I am attempting to convert PDFs to java.awt.Image objects using the below method:

public Image createImage(DocumentContent docContent, ThumbnailProperties properties) {
		PdfConverter converter = new PdfConverter();
		converter.bindPdf(new ByteArrayInputStream(docContent.getContent()));
		ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
		try {
			if (converter.hasNextImage()) {
				converter.getNextImage(outputStream, ImageType.BMP);
			Image image = ByteArrayInputStream(outputStream.toByteArray()));
			return image;
		} catch (Exception e) {
			throw new ServiceException("Failed to create thumbnail for properties:" + properties, e);

I have installed JAI 1.1.3 (jai-1_1_3-lib-windows-i586) from here and added jai_codec.jar and jai_core.jar to my CLASSPATH.

Unfortunately, I get the following exception:

	at com.aspose.pdf.kit.jl.b(Unknown Source)
	at Source)
	at com.aspose.pdf.kit.iu.b(Unknown Source)
	at com.aspose.pdf.kit.iu.a(Unknown Source)
	at Source)
	at com.aspose.pdf.kit.ju.a(Unknown Source)
	at com.aspose.pdf.kit.PdfConverter.doConvert(Unknown Source)
	at com.sentry.thumbnails.dao.aspose.AsposePdfKitThumbnailGenerator.createImage(
	at com.sentry.thumbnails.dao.aspose.TestAsposePdfKitThumbnailGenerator.testPdftoJpg(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(
	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(
	at org.junit.runners.ParentRunner$
	at org.junit.runners.ParentRunner$1.schedule(
	at org.junit.runners.ParentRunner.runChildren(
	at org.junit.runners.ParentRunner.access$000(
	at org.junit.runners.ParentRunner$2.evaluate(
	at org.junit.internal.runners.statements.RunBefores.evaluate(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

Hi Jake,

Thanks for contacting support.

I have tested the scenario using Aspose.Pdf.Kit for Java 4.5.0 over Windows 7 (X64) where I have JDK 1.7 installed and I am unable to notice any issue when I have used one of my sample PDF files. Can you please share the source PDF file which you are using so that we can test the scenario at our end. We are sorry for this inconvenience.

I believe I have figured out this issue after a little more research. It appears that JAI only supports 32 bit JREs. I switched to 32bit Eclipse and 32 bit JDK and the same code now succeeds.

Is it possible to rasterize a PDF to an image using PDF.Kit with a 64bit JRE?

Hi Jake,

I have tested the scenario over Windows 7 (X64) where I have jdk1.7.0_09 (X64) installed over my system and I have used Eclipse JUNO Version: Juno Service Release 1 - Build id: 20120920-0800 (X64) and as per my observations, I am unable to notice any issue during conversion process. Please note that I have used jai_imageio_windows_i586.jar and jai_windows-i586.jar, sun-jai_core.jar files in class path reference.

Where are these JAR files available? After installing JAI, I do not see these.

Hi Jake,

The requested Jars can be downloaded from following links.

  • [jai_imageio_windows_i586.jar](
  • [jai_windows-i586.jar](
  • [sun-jai_core.jar](

In case you still face the same issue, please feel free to contact.

I have added these to my classpath and still get this error. I have attached a screenshot of my build path. When running under a 32bit JRE, everything works fine with or without these jars.

I noticed that contained within jai_imageio_windows_i586.jar and jai_windows-i586.jar were executable installers. I installed these, but that didn’t help either.

I also switched from jdk1.6.0_43 (64bit) to jdk1.7.0_21 (64bit). Neither work, but I have been able to get jdk1.6.0_43 (32bit) and jdk1.7.0_21 (32bit) to work. Also, just to note: I am using Windows 7 64bit and Eclipse Juno.

No combination of the mentioned JAR files, 64bit JRE, installation of the installers embedded in the JARs has been able to produce anything other than the exception above. I have attached a PDF that exhibits this problem, but it doesn’t seem to be limited to any particular PDF since I have tried several.

Hi Jake,

Thanks for sharing the details and sorry for the delayed response.

Please take a look over attached image file which highlights/shows the JAR files which I have referenced in my application. Please note that I have jdk1.7.0_09 (X64) installed over Windows 7(X64) Enterprise and I have used Eclipse Version: Juno Service Release 1 - Build id: 20120920-0800 and as per my observations, when I have tried converting PDF document to Image format using new Aspose.Pdf for Java 4.0.0, I am unable to notice any problem.

For your reference, I have also attached the JAR files which are referenced in my application. In case you still face the same problem, please do let us know. We are sorry for this delay and inconvenience.