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

Free Support Forum - aspose.com

Exception: RasterFormatException on converting pptx to PDF (Java)

Converting the attached file to PDF gives the following exception:

java.awt.image.RasterFormatException: x lies outside the raster
	at sun.awt.image.ByteInterleavedRaster.createWritableChild(ByteInterleavedRaster.java:1239) ~[?:1.8.0_221]
	at java.awt.image.BufferedImage.getSubimage(BufferedImage.java:1202) ~[?:1.8.0_221]
	at com.aspose.slides.internal.ft.int.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.internal.ey.if.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.internal.ey.if.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.internal.ef.do.if(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.internal.ef.throw.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.internal.dx.final.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.internal.dx.goto.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.internal.dx.case.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.internal.dx.goto.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.internal.dx.case.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.internal.dx.goto.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.internal.dx.super.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.internal.ef.throw.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.acw.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.acw.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.Presentation.do(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	at com.aspose.slides.Presentation.save(Unknown Source) ~[aspose-slides-19.10-jdk16.jar:19.10]
	...

I’m using Presentation.save(String, int, ISaveOptions) and passing a PdfOptions object having only the following settings:

  • Compliance: PdfA1b
  • JPEG quality: 90

Test Presentation.zip (968.5 KB)

@cdokolasiac,

I have observed the stack trace shared by you and request you to please try using latest Aspose.Slides for Java 19.11 on your end. If the issue still persist then please share the sample code, Java and Operating System details on your end.

It’s funny; I assumed that the Aspose.Total download had the latest versions, but it doesn’t.

I downloaded Slides separately to get v19.11. I’ll let you know how it goes.

Thanks

@cdokolasiac,

I am sorry for your inconvenience. Please try using latest version and in case issue still persist then please share the sample code, Java and Operating System details on your end.

The issue persists as you can see below:

java.awt.image.RasterFormatException: x lies outside the raster
	at sun.awt.image.ByteInterleavedRaster.createWritableChild(ByteInterleavedRaster.java:1239) ~[?:1.8.0_221]
	at java.awt.image.BufferedImage.getSubimage(BufferedImage.java:1202) ~[?:1.8.0_221]
	at com.aspose.slides.internal.ft.int.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.internal.ey.if.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.internal.ey.if.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.internal.ef.do.if(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.internal.ef.throw.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.internal.dx.final.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.internal.dx.goto.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.internal.dx.case.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.internal.dx.goto.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.internal.dx.case.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.internal.dx.goto.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.internal.dx.super.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.internal.ef.throw.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.act.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.act.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.Presentation.do(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at com.aspose.slides.Presentation.save(Unknown Source) ~[aspose-slides-19.11-jdk16.jar:19.11]
	at scancommon.msoffice.MSPowerPointProcessor.toPDF(MSPowerPointProcessor.java:89) ~[classes/:?]
	...

The code is really straightforward:

    PdfOptions pdfSaveOptions = new PdfOptions();
    pdfSaveOptions.setCompliance(PdfCompliance.PdfA1b);
    pdfSaveOptions.setJpegQuality((byte) 90);
    try {
      doc.save(out.getAbsolutePath(), SaveFormat.Pdf, pdfSaveOptions);
    } catch (Exception ex) {
      throw new DocumentProcessingException("Unable to save PDF document", ex);
    }

I’m using Oracle jdk1.8.0_221 x64 on WIndows 10.

@cdokolasiac,

Thank you for sharing the feedback. An issue with ID SLIDESJAVA-38005 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

It was working in release 19.9 , then the error is occurring in the releases 19.10 / 19.11 / 19.12.

@geert_vanpeteghem_docshifter_com,

Can you please confirm if you are having same or similar issue as reported in this thread above. If you have separate issue then please share all necessary details with us so that we may add information in our issue tracking system.

Hello It’s a similar issue.

@geert_vanpeteghem_docshifter_com,

In this case then I request you to please be patient and we will share the good news with you as soon as the issue will be fixed.

The issues you have found earlier (filed as SLIDESJAVA-38005) have been fixed in this update.