Document to byte array performance times

Hello I am currently investigating some performance issues we’re having in our application. I have traced the problem to converting the first page of a document to a byte array. I have a simple 370kb file which takes 10-20 seconds to process. Clients have reported file size does not seem to matter, times are all roughly the same regardless.

Lowering the quality does increase times but we are looking to keep the quality as close to original as we can.

    var pdfDocument = new Document(file.FullName);
    Resolution resolution = new Resolution(100);
    return pdfDocument.Pages.FirstOrDefault().AsByteArray(resolution);

Would there be a better way to approach this?

This is using Aspose.pdf ver 21.7

Thank you.

@cNQ

Could you please try using the latest version i.e. 22.6 as we improve API performance-wise in every release? In case you still notice time delay, please share some more details like the .NET Framework version, installed RAM Size, and OS Version along with a sample PDF file. We will test the scenario in our environment and address it accordingly.

@asad.ali
Thank you for the reply, I upgraded our Aspose references and have heard back from QA that the image return time has significantly improved. Pdf 22.6 seems to have resolved our issues.

Thank you

@cNQ

It is great to know that your issue has been resolved. Please keep using our API and feel free to create a new topic in case you face any issues.