Load PDF document in Java using Aspose.PDF - Document object Creation Takin Time

hi
i have the below code just to create a Document object from the input stream but it is taking around 12 mins
logger.error("start time "+new Date());
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document (fileInputStream);
logger.error("end time "+new Date());

@rupeshUltria

In your code snippet, you are initializing the Document object with a file stream. Would you please share respective PDF file with us so that we can test the scenario in our environment and address it accordingly.

PFA
DemoPdf (2).pdf (199.1 KB)

@rupeshUltria

We have tested the scenario in our environment using Aspose.PDF for Java 20.11 and did not notice any issue. The API took 5 seconds upon first run whereas on subsequent runs, API took less than one second. Would you kindly make sure that you are using the latest version of the API? In case you still face any issue, please let us know.

It is taking time for the first time only form the second time it is taking less time
we are using Aspose PDF 10.4.0 and Aspose Words 16.7.0

@rupeshUltria

Please try to use the latest versions of all the Aspose APIs you are working with as the support is provided on the basis of the latest available versions and it is always recommended to use them due to latest improvements and fixes in them.

Furthermore, the performance of the API should be calculated on the basis of the results obtained after subsequent executions. The reason is, API loads all necessary resources in the memory to use them on first run and once all resources are already present in the memory, API gives expected performance. Please feel free to let us know in case you need further assistance.