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

Free Support Forum - aspose.com

Convert PDF to image failed with aspose-pdf-kit-4.0.1.jar

Hi,


I got exception when convert pdf to image(JPG、PNG) with aspose-pdf-kit-4.0.1.jar, the exception is :

java.lang.NoSuchFieldError: TRACKING
at com.aspose.pdf.kit.kn.a(Unknown Source)
at com.aspose.pdf.kit.lb.a(Unknown Source)
at com.aspose.pdf.kit.io.a(Unknown Source)
at com.aspose.pdf.kit.qs.a(Unknown Source)
at com.aspose.pdf.kit.io.a(Unknown Source)
at com.aspose.pdf.kit.io.a(Unknown Source)
at com.aspose.pdf.kit.lb.a(Unknown Source)
at com.aspose.pdf.kit.io.b(Unknown Source)
at com.aspose.pdf.kit.io.a(Unknown Source)
at com.aspose.pdf.kit.lb.a(Unknown Source)
at com.aspose.pdf.kit.jo.a(Unknown Source)
at com.aspose.pdf.kit.PdfConverter.doConvert(Unknown Source)

My source code is:
public void pdfSaveAsImages() throws Exception {
PdfConverter converter = new PdfConverter();
converter.setResolution(192);
converter.bindPdf(“C:\mypdf.pdf”);
converter.doConvert();
// converter.saveAsTIFF(“C:\images\pdf_image.tiff”);
String prefix = “C:\images\pdf_”;
String suffix = “.jpg”;
int imageCount = 1;
while (converter.hasNextImage()) {
converter.getNextImage(prefix + imageCount + suffix, ImageType.JPEG);
imageCount++;
}
}

Hi Sheng,

Could you please share the input PDF file with us as well? Such issues are usually caused by the particular structure or contents of the PDF file. We’ll investigate the issue at our end and guide you accordingly.

We’re sorry for the inconvenience.
Regards,

Thank you for your reply.


I uploaded my PDF file as attachement.

Hi Sheng,

Thank you very much for sharing the sample PDF file with us. We’ll further investigate the issue and update you with the results shortly.

We’re sorry for the inconvenience.
Regards,

Thank you for your reply again.

My OS is Windows XP SP3

Hi Sheng,

I have tested this issue at my end using Aspose.Pdf.Kit for Java 4.0.1 but couldn’t reproduce your particular issue. I have tested this issue both on Windows 7 and Windows XP. I have used JDK 1.6. I have only noticed that on Windows XP although no exception is thrown as you shared, the output images do not contain the proper text either. We’ll log this issue separately.

In the meanwhile, could you please make sure that you’re using this latest version (4.0.1)? That is, the CLASSPATH etc. are set to this version. If you’re using the correct version then please share which JDK version you’re using at your end. We’ll further investigate it and update you accordingly.

We’re sorry for the inconvenience and looking forward to help you out.
Regards,