Performance issue and out of memory exception using aspose words

Hi,

We are using Aspose words API through html input and word templates “.dotx” to produce word documents. Please use following code to produce the scenario:

string filePath = @"[DirectoryName]:\Myhtmlfile.html";
string dotxFilePath = @"[DirectoryName]:\MyWordTemplate.dotx";
string docxFilePath = @"[DirectoryName]:\MyOutputWord.docx";

Document htmlDoc = new Document(filePath, new Aspose.Words.HtmlLoadOptions() {LoadFormat =LoadFormat.Html, Encoding = Encoding.UTF8});
Document templateDoc = new Document(dotxFilePath );

templateDoc .AppendDocument(htmlDoc, ImportFormatMode.UseDestinationStyles);
SaveOutputParameters param = templateDoc.Save(docxFilePath );
/---------------------------------------------------------------------------------------------------------------------------------------------/

“Document htmlDoc = new Document(filePath, new Aspose.Words.HtmlLoadOptions() {LoadFormat =LoadFormat.Html, Encoding = Encoding.UTF8});”

The above line takes 58 mintutes to load html input and the below line of code of saving document throws out of memory exception.

SaveOutputParameters param = templateDoc.Save(docxFilePath );

Use html “AgileHdImages5000.zip” and template “Blank.dotx” to produce the scenario

AgileHdImages5000.zip (193.6 KB)

Blank.zip (8.7 KB)

Kindly look in to the issue and let us know the findings.

Regards,
Asif.

@asifsharif

It is quite difficult to answer such questions because CPU performance and memory usage all depend on complexity and size of the documents you are loading/generating.

In your document, you are accessing images from https://dev.azure.com/ and c:\ drive. If you open this document in browser and MS Word, it will also take time.

Hi Tahir,

Even if the document does not contain images it takes about 27 mins on a system having 16 gb of RAM, the time can vary on other systems to generate the document. Atttached file “test.zip” contains the html file.

test.zip (266.6 KB)

Please look into it and suggest some thing because the time is not acceptable for our clients.

Regards,
Asif.

@asifsharif

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-18651. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-18651) have been fixed in this Aspose.Words for .NET 19.8 update and this Aspose.Words for Java 19.8 update.