Free Support Forum -

Convert PDF to JPG in Java - Output has missing content - Landray RDM 94099

pdf source code: (4.4 KB)

origin pdf:
星盛-寰球 (9.6 KB)

converted problem:
convert error.jpg (118.1 KB)

It was missed content.please have a check.


I have worked with source files and sample code shared by you using Aspose.Pdf and unable to observe the issue. Can you please share environment details along with version which you are using on your end. I have also shared my generated result for your kind reference.111r.jpg (20.7 KB)

Error information:


Caused by:java.lang.NoClassDefFoundError: jdk/nashorn/internal/runtime/regexp/RegExp

com.aspose.pdf.internal.l4y.l1h.lI(Unknown Source)
com.aspose.pdf.internal.l4y.l1h.l2n(Unknown Source)
com.aspose.pdf.internal.l4y.l1h.l1u(Unknown Source) Source)
com.aspose.pdf.internal.l4y.l1h.l0y(Unknown Source)
com.aspose.pdf.internal.l4y.l2t.l0y(Unknown Source)
com.aspose.pdf.internal.l3h.lj.lI(Unknown Source)
com.aspose.pdf.internal.l2u.l0h.lf(Unknown Source) Source) Source) Source)
com.aspose.pdf.devices.lI.lI(Unknown Source)
com.aspose.pdf.devices.lI.lI(Unknown Source)
com.aspose.pdf.devices.ImageDevice.lI(Unknown Source)
com.aspose.pdf.devices.PngDevice.processToBufferedImage(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

I used the version of aspose-pdf-20.7.jar to convert this 星盛-寰球 (9.6 KB),it was error,please tell me how to settle it.


We were unable to notice any exception in our environment while testing the scenario with Aspose.PDF for Java 20.7. Please check following code snippet that we used for testing purpose:

Document pdfDocument = new Document(dataDir + "星盛-寰球201911.pdf");
for (Page page : pdfDocument.getPages()) { imageStream = new + "Converted_Image_" + page.getNumber() + ".jpg");
 com.aspose.pdf.devices.Resolution resolution = new com.aspose.pdf.devices.Resolution(162);
 com.aspose.pdf.devices.JpegDevice jpegDevice = new com.aspose.pdf.devices.JpegDevice(resolution, 162);
 jpegDevice.process(page, imageStream);

Would you kindly make sure that the font used in attached PDF is installed in your system. In case you still face any issue, please let us know.

But it was successful by java 20.6 in my macbook,I didn’t change any code,just replaced java 20.6 to java 20.7.I don’t know how to deal with it.


Please try to clean all the JARs and deploy them again. Also, try to change the path of maven local repository in your system and let us know in case it helps. Otherwise, please share complete environment details i.e. OS name and version, JDK Version, Application type, etc. with us. We will further proceed to assist you accordingly.