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

Free Support Forum - aspose.com

Docx to pdf conversion takes very long time

Hi,
I am using Aspose Words (version 14.7.0) to convert DOCX to PDF in Web application.
The conversion works fine, but after a few days of application working the conversion performance is very poor. One page DOCX is converted
to PDF more than 10 minutes.
What could be the reason?


Paweł

Hi Paweł,


Thanks for your inquiry. Could you please attach your input Word document you’re getting this problem with here for testing? We will investigate the issue on our end and provide you more information.

Best regards,

Thank you for your replay.
In attachment u can find sample file.
As I said problem appears after longer period of time.
I observed also that JVM starts intensive call gc. Maybe any memory leak?

Hi Paweł,


Thanks for your inquiry. After an initial test with Aspose.Words for Java 14.8.0, I was unable to reproduce this issue on my side. I would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link. I hope, this helps.
http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/default.aspx

Best regards,

well, look at this.
here is a soure code:

logger.info("coversion “+tempFile+” —> "+pdfFile);
com.aspose.words.Document doc = new com.aspose.words.Document(new FileInputStream(tempFile));

PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.setWarningCallback(new IWarningCallback() {
@Override
public void warning(WarningInfo arg0) {
logger.warn(arg0.getDescription());
}
});
logger.info(“monit loaded”);
doc.save(pdfFile.getAbsolutePath(), saveOptions);
logger.info(“monit converted to PDF”);
tempFile.delete();


and this is a log:

2014-09-15 12:10:35,781 INFO [pl.app.DocxUtil] coversion /tmp/wordexport-8935.docx —> /tmp/merged_8938tmp.pdf
2014-09-15 12:10:36,618 INFO [pl.app.DocxUtil] monit loaded

(8 minutes later!!!)

2014-09-15 12:18:49,320 WARN [pl.app.DocxUtil] Table column widths may need to be calculated. Rendered column widths could differ.
At Table 2, Section 1
2014-09-15 12:18:49,320 WARN [pl.app.DocxUtil] DrawingML shapes are not fully supported. Object could be rendered differently.
At DrawingML Object 113.3x42.25, Paragraph 1, Cell 1, Row 1, Table 2, Cell 1, Row 1, Table 3, Section 1
2014-09-15 12:18:49,320 WARN [pl.app.DocxUtil] DrawingML shapes are not fully supported. Object could be rendered differently.
At DrawingML Object 174.729x72.302, Paragraph 1, Cell 2, Row 1, Table 2, Cell 1, Row 1, Table 3, Section 1
2014-09-15 12:18:49,320 WARN [pl.app.DocxUtil] Soft hyphens present in text. Content might wrap differently.
2014-09-15 12:18:49,320 WARN [pl.app.DocxUtil] Soft hyphens present in text. Content might wrap differently.
2014-09-15 12:18:49,320 WARN [pl.app.DocxUtil] DrawingML shapes are not fully supported. Object could be rendered differently.
At DrawingML Object 120.35x56.4, Paragraph 1, Primary Header, Section 1
2014-09-15 12:18:49,320 WARN [pl.app.DocxUtil] DrawingML shapes are not fully supported. Object could be rendered differently.
At DrawingML Object 468.85x69.65, Paragraph 1, Primary Footer, Section 1
2014-09-15 12:18:49,321 WARN [pl.app.DocxUtil] Tag with name ‘rect’ is not supported.
2014-09-15 12:18:50,641 INFO [pl.app.DocxUtil] monit converted to PDF



Hi Pawel,


Thanks for the additional information. I am afraid, I was still unable to reproduce this issue on my side using Aspose.Words for Java 14.8.0. Please make sure that you are using 14.8.0 on your end. Also, could you please tell us the details of the development environment (e.g. OS, JDK versions) of the machine you’re getting this problem on during rendering Docx to Pdf. We will investigate the issue further on our end and provide you more information.

Best regards,

Hi again,
I’m using 14.8.0 version with Web application (Gwt/Hibernate/Spring) on 6.0.32 Tomcat (but when run with JBoss is the same problem) on openSUSE 11.4 (i586)
JVM = 1.6_032

As I said the problem appears after few days of application running.
Immediately after application start conversion is very fast but every day is getting longer. After 2 weeks one page docx is converted to pdf in half an hour. After application restart conversion is fast again, but I cannot restart application every day.


Maybe there is any problem with temp files or temp directories, used fonts? Let me know what can be possible reason.

Paweł


Hi Paweł,


Thanks for the additional information.

1- Please note that Aspose.Words for Java does not close given input stream – you should close it by yourself. For example, it is better to close the stream in finally block. The new com.aspose.words.Document(new FileInputStream(tempFile)); - if “Document(InputStream)” overload is used, you should close the InputStream manually, because the overload does not close the stream. You should close the stream, or use another overload i.e. “Document(String fileName)”. The latter is better choice, because it uses optimal buffering and automatically opens/closes input stream.

2- The tempFile.delete(); - some JVMs, especially in conjunction with Tomcat or other application servers, do not properly delete temp files. It can delete them only after restart of the server or even do not delete them at all. So, it is better to create and delete temporary files manually.

I hope, this helps.

Best regards,