We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Mail/merge Data is taking ltime which is causing the Timeout on client side

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.");
		}
	}

@vkuppireddy,

Are you using the latest (21.9) version of Aspose.Words for Java on your end? In case the problem still remains, then please create a standalone simplified Java Application (source code without compilation errors) that helps us to reproduce this problem on our end, compress it into ZIP format and attach the .zip file here for testing. Please also provide related Word (DOCX etc) files used by the app. Please do not include Aspose.Words JAR files in it to reduce the file size. We will then investigate the issue on our end and provide you more information.