Taking too much time to create pdf or word file

I have installed Aspose.Word version 22.11 using java and creating file from template. it’s taking much time to create pdf and word file if the file pages are more then 1000-1200, so how to fix this issue let me know if have any question.
Thank you.

@kalpeshAspose1997 The time required for document generation depends on the document size and it’s complexity, as well as from the available resources. Also, it is expected that PDF document generation takes more time then saving to DOC or DOCX format, since PDF generation requires building document layout.
It is not recommended to use such huge documents, since even native consumer apps, such as MS Word, not always can handle such big documents well.

Yes, but the process get fail in this type of huge data so is there any way to manage this?

@kalpeshAspose1997 Could you please elaborate the problem in more details. What exception does Aspose.Words throws? If possible please create a simple application that will allow us to reproduce the problem.

yes, how many pages are you allow to create pdf/word smoothly and is there any functionality for identify the number of page will be going to generate so can set limit form my end

@kalpeshAspose1997 All depends on the document complexity and resources available on your side. There is no way to calculate number of pages in the document without building document layout, which is quite resource and time consuming operation.
In general normal size of MS Word document is about 100-200 pages.

1 Like

Hello @alexey.noskov
Sometimes it takes too long (more then 8 hour) to converts a 1000-1200 page docx (template) files to word/pdf.

Any suggestion what could cause such delays in conversion?

FYI we use jdk 17, aspose word 22.11

Thanks.

@kalpeshAspose1997 Unfortunately, it is difficult to say what causes the problem without a real document. As I have mentioned 1000-1200 page docx file is considered as an abnormally big document and it is not recommended to use such large documents.
If possible please attach the problematic document here for testing. We will check it on our side and provide you more information.

Hello @alexey.noskov

We are using the method executeWithRegions() with dataset (we are using large amount of data in our dataTable), but this method unfortunately results in a OutOfMemory exception, is there any particular reason behind this exception.

FYI: we use jdk 17, aspose word 22.11

Do you have any solution on how I can fix this issue?

Exception : 
java.lang.OutOfMemoryError: Java heap space

06-12-2023 13:56:00.331 +0000 ERROR t=ThreadPoolTaskExecutor-23 l=org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler - Unexpected exception occurred invoking async method: public void com.test.asynctest.Report.testPDFWordExport(com.test.model.Test,java.lang.String,java.lang.String,java.lang.String)

Local Exception Stack: 

Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.10.v20211216-fe64cd39c3): org.eclipse.persistence.exceptions.DatabaseException

Internal Exception: java.sql.SQLNonTransientConnectionException: No operations allowed after connection closed.

@kalpeshAspose1997 According to the provided stack trace the problem occurs because there is not enough memory to generate a large report. So the only solution I can suggest is increasing java heap space on your side.

Okay, I would like to know, is there any limit for the number of the MergeFields that can be used?

@kalpeshAspose1997 There is no limit for the number of the MergeFields that can be used. The only limit is the available memory. Please see our documentation to learn more about Aspose.Words memory requirements:
https://docs.aspose.com/words/net/memory-requirements/