Hello ,
We are using aspose to generate the PDF byte array…and some times its is getting timeoout because of the data size. I would like to know how to Optimize this.
The below sample is taking close to 50 secs
private void saveDocument(Document document, String outputFileName)
{
StopWatch stopWatch = new StopWatch();
stopWatch.start();
try
{
PdfSaveOptions pdfOptions = new PdfSaveOptions();
pdfOptions.setMemoryOptimization(true);
pdfOptions.setZoomBehavior(PdfZoomBehavior.FIT_WIDTH);
document.save(outputFileName, pdfOptions);
}
catch(Exception e)
{
LOGGER.error("Exception while saving PDF document :: " + e.getMessage());
throw new ResponseStatusException(HttpStatus.FAILED_DEPENDENCY, "Exception while saving PDF document - " + e.getMessage());
} finally {
stopWatch.stop();
LOGGER.debug("Time taken for : saving pdf document - "+stopWatch.getTotalTimeMillis()+"ms.");
}
}