Takes very long time to convert pdf to image

Any update on this issue ?
We are using almost the similar implementation , and it is taking a very long to convert for large documents.
If not, do you suggest any alternative ?

@Nikita_Buxy

Are you using the latest version of the API? Please share your sample PDF document that you are using for conversion into images. We will test the scenario in our environment and address it accordingly.

I am using 20.12 version of Aspose.pdf Java.I have a multithreaded setup , with a max of 5 threads, each thread converting one pdf to pngs. The pdf document size varies say from 1 to 100.
The below code is executed for generating PNGs for all the pages of each pdf.
On profiling, at times even a 10 page PDF is take 2-3 mins for converting to page images.
Also, the CPU consumption is to the max at all times with aspose conversion eating up

for (var pageCount = 1; pageCount <= noOfPages; pageCount++) {
            // Create stream object to save the output image
            try (OutputStream imageStream = new FileOutputStream(tmpDir.toString() +
                                                                 File.separator +
                                                                 pageCount +
                                                                 Constants.DOT +
                                                                 Constants.THUMBNAIL_IMG_FORMAT)) {
                page = pdfDocument.getPages()
                                  .get_Item(pageCount);

                var resolution = new Resolution(40);
                var pngDevice = new PngDevice(resolution);
                pngDevice.process(page, imageStream);
            } catch (FileNotFoundException e) {
                log.error("Thumbnail not generated of documentId {} with pageNo {}  ", documentId, pageCount, e);
            }
        }

To add the aspose conversion is using higher % of CPU of the container in which service is deployed.
image.png (131.9 KB)

Is there any update on this issue (Mine is similar)?

@Nikita_Buxy

The linked and referenced tickets were logged for Aspose.PDF for .NET whereas you are using Java API. Please note that we have improved API for multi-threaded scenarios and improvements are included in the latest version of the API. Please try to test your case using 21.7 version and let us know about the results you get at your side.