Problem with a PDF page converting to jpeg image

I am trying to convert all pages of a PDF to jpeg image using very similar JAVA example as given by you in code examples. I am able to convert many PDFs successfully for all pages but with a specific PDF while trying to convert it gives an exception while converting 2nd page though 1st page conversion of same PDF is fine. Could you please address this issue as early as possible? Please note our team has corporate license from you for aspose.total.java package and if the product will not work with all PDF conversion correctly then it will be trouble for us. Please note below important details for this issue:

  1. Source Code is attached.

PDFConverterToJpeg.zip (839 Bytes)

  1. The PDF with which I am facing trouble is attached.

test.pdf (324.3 KB)

  1. I am using aspose-pdf-21.1.jar.
  2. The error message is:

class com.aspose.pdf.internal.ms.System.l5if: class com.aspose.pdf.internal.ms.System.lv: Arguments should lies in interval [0, 1]
Parameter name: component
com.aspose.pdf.internal.l2p.lc.(Unknown Source)
com.aspose.pdf.internal.l2u.lu.lI(Unknown Source)
com.aspose.pdf.internal.l2u.lu.lf(Unknown Source)
com.aspose.pdf.internal.l2u.lu.lI(Unknown 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.JpegDevice.processInternal(Unknown Source)
com.aspose.pdf.devices.JpegDevice.process(Unknown Source)
test.PDFConverterToJpeg.main(PDFConverterToJpeg.java:42) —> class com.aspose.pdf.internal.ms.System.lv: Arguments should lies in interval [0, 1]
Parameter name: component
com.aspose.pdf.internal.l2p.lc.(Unknown Source)
com.aspose.pdf.internal.l2u.lu.lI(Unknown Source)
com.aspose.pdf.internal.l2u.lu.lf(Unknown Source)
com.aspose.pdf.internal.l2u.lu.lI(Unknown 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.JpegDevice.processInternal(Unknown Source)
com.aspose.pdf.devices.JpegDevice.process(Unknown Source)
test.PDFConverterToJpeg.main(PDFConverterToJpeg.java:42)
— End of inner exception stack trace —
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.JpegDevice.processInternal(Unknown Source)
com.aspose.pdf.devices.JpegDevice.process(Unknown Source)
test.PDFConverterToJpeg.main(PDFConverterToJpeg.java:42)
at com.aspose.pdf.devices.lI.lI(Unknown Source)
at com.aspose.pdf.devices.lI.lI(Unknown Source)
at com.aspose.pdf.devices.ImageDevice.lI(Unknown Source)
at com.aspose.pdf.devices.JpegDevice.processInternal(Unknown Source)
at com.aspose.pdf.devices.JpegDevice.process(Unknown Source)
at test.PDFConverterToJpeg.main(PDFConverterToJpeg.java:42)
Caused by: class com.aspose.pdf.internal.ms.System.lv: Arguments should lies in interval [0, 1]
Parameter name: component
com.aspose.pdf.internal.l2p.lc.(Unknown Source)
com.aspose.pdf.internal.l2u.lu.lI(Unknown Source)
com.aspose.pdf.internal.l2u.lu.lf(Unknown Source)
com.aspose.pdf.internal.l2u.lu.lI(Unknown 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.JpegDevice.processInternal(Unknown Source)
com.aspose.pdf.devices.JpegDevice.process(Unknown Source)
test.PDFConverterToJpeg.main(PDFConverterToJpeg.java:42)
at com.aspose.pdf.internal.l2p.lc.(Unknown Source)
at com.aspose.pdf.internal.l2u.lu.lI(Unknown Source)
at com.aspose.pdf.internal.l2u.lu.lf(Unknown Source)
at com.aspose.pdf.internal.l2u.lu.lI(Unknown Source)
… 6 more

An early resolution of this issue will be highly appreciated and very much needed. Please let me know in case you have any more questions.

@sumitjhanfl

A ticket with ID PDFJAVA-40893 has been created in our issue tracking system to further investigate the issue on our end. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

Thank you for update!!! I am eagerly waiting for resolution of this issue.

@sumitjhanfl

We will let you know once it will be fixed.

Is there any update on this issue? As I have not heard anything so asking. To get a fix or solution for this issue is critical for us to go to production.

@sumitjhanfl

Please note that it was recently logged in free support model and will be investigated and resolved on a first come first serve basis. We will surely inform you as soon as we make some definite progress towards its resolution. Please be patient and spare us some time.

Is there any update on this issue resolution? Please let me know.

@sumitjhanfl

We are afraid that the issue has not been yet resolved due to other issues in the queue logged prior to it. However, we will surely let you know as soon as we have some definite updates regarding issue fix. Please spare us some time.

We apologize for your inconvenience.

Is there an update on this issue? Is this resolved yet? If yes then what is resolution? Please let me know.

@sumitjhanfl

We would like to share with you that the issue has been resolved and its fix will be announced at the time of release of 22.2 version soon. We will send you a notification in this forum thread once new update is released. The following code snippet successfully converted your PDF:

         Document pdfDocument = new Document(inputPdf);
         for (int pageCount = 1; pageCount <= pdfDocument.getPages().size(); pageCount++) {
            java.io.OutputStream imageStream = new java.io.FileOutputStream(outputDir + "Converted_Image" + pageCount + ".Jpeg");
            Resolution resolution = new Resolution(300);
            JpegDevice jpegDevice = new JpegDevice(resolution, 100);
            RenderingOptions renderingOptions = new RenderingOptions();
            renderingOptions.setTryToSkipDocumentErrors(true);
            jpegDevice.setRenderingOptions(renderingOptions);
            jpegDevice.process(pdfDocument.getPages().get_Item(pageCount), imageStream);
            imageStream.close();
        } 

Furthermore, another ticket as PDFNET-51291 has been logged in our issue tracking system because the document should be converted successfully without using setTryToSkipDocumentErrors option. We will further proceed to fix it as well.

Thanks for update, I appreciate it a lot!!!

Seems like setTryToSkipDocumentErrors() method will be new method added in RenderingOptions class when version 22.2 will be released for aspose-pdf jar. I have a question if I will use that new method then I understand that I will not face issue while converting with this pdf where I was facing issue earlier. But I just wanted to ensure that it will not give any unexpected problem with other PDFs where I was not getting any trouble already while converting i.e. other PDFs will convert fine as it is converted currently, correct? Please confirm.

I agree that we should not even need to use setTryToSkipDocumentErrors option and without this document should be converted fine and I see that you have created a new issue PDFNET-51291 to accomplish that. But please note its JAVA related issue then why you are logging in “.net” as name suggest that PDFNET-51291? Should it be something like PDFJAVA-XXXXX?

@sumitjhanfl

Yes, your understandings are correct.

Yes, you are right as we also tested in our environment and did not face any issue.

Yes, you are right. This option will not impact the conversion process which was successfully being done at your side.

The Aspose.PDF for Java API has been ported from .NET API. Which means, every fix or enhancement is first implemented in .NET API and then ported into equivalent version of Java API. As soon as the feature is implemented in Aspose.PDF for .NET, it will then be ported into Java version as well.

Could you please let me know latest status on this issue?

@sumitjhanfl

We are afraid that the earlier logged ticket has not been yet resolved. However, as soon as it is resolved or we have some information about its resolution ETA, we will inform you in this forum thread. Please spare us some time.

We apologize for the inconvenience.

Seems PDFJAVA-40893 issue has resolved with aspose-pdf.jar 22.2 version release based on release notes, am I correct? I was just not informed about this version has released. So I got doubt?

I understand PDFNET-51291 related issue created may have not been fixed so far relating to your comment - Furthermore, another ticket as PDFNET-51291 has been logged in our issue tracking system because the document should be converted successfully without using setTryToSkipDocumentErrors option. We will further proceed to fix it as well.

@sumitjhanfl

Yes, you are right. The issue was closed in 22.2 version. We apologize that this thread got skipped by our notification service. We will check it so that it would not happen again.

The issues you have found earlier (filed as PDFNET-51291) have been fixed in Aspose.PDF for .NET 24.2.