Long Time Taken in Aspose.Pdf Loading

Hi Team,

Aspose.pdf is taking too long time in the first request loading. Please check the issue. It is generating the production down time issue. Aspose.pdf version is 23.7. Java version is 17.

@praveenrchilli

Can you please share a little bit more details like the sample file and the code snippet for our reference? We will further proceed to assist you accordingly.

Hi Asad,

I am passing any pdf file, every time it is taking too long time on the first request, whenever I deploy the build. I checked, all the fonts including msttcorefonts, all are there, but I don’t know why it is taking time. I tested it on the Europe region server. Please assits.
Code snippet is attached here: image.png (35.2 KB)

@praveenrchilli

Thanks for sharing the details. Please note that the performance of the API is measured upon subsequent executions. At the first loading, API loads all necessary resources e.g. Fonts into memory that causes time difference in loading the PDF first time as compared to the 2nd time loading. You can try loading all fonts before the document loading by using FontRepository.loadFonts() method to see if it speeds up the process.

Furthermore, you can initialize the Document object as soon as your application starts, instead of waiting for the first request. Please let us know if any of these suggestions worked for you. In case issue still persists, please share with us.