I have a template that is 20mb and has a number of merge fields and tables that I am using ExecuteWithRegions, and the whole thing returns in 2 seconds on my local dev machine. But when I try to add the UpdateFields call to update the table of contents it never returns no matter how long the timeout is set and the Mem Usage ramps up over 1.2 Gb. Please give me some advice or an alternative for updating the TOC.
Travis
Hi
Thanks for your request. The problem occurs because for updating TOC Aspose.Words needs to build document’s layout. Aspose.Words renders about 10 pages per second. So you can approximately calculate how much time it will take to render your document.
Also, I would notice that 20MB MS Word document is huge. Even MS Word does not like such large documents and works quite slow with them.
Best regards,
Thanks for the reply, but it appears there seems to be more to this.
I listened to what you said about size and stripped out as much as I could to still test the features I need. I got the “template” file down to 543kb and switched the file over to docx from doc.
I run through the file generation without the call to UpdateFields and it returns the file in just over 3 seconds. But as soon as I turn that call back on the same thing happens. It just churns and churns, the Mem Usage goes all the way over 1.3 GB and I waited 20 minutes before killing it.
It is likely something in the way I am doing, but there is nothing that is obvious.
I was having the same issue using the MailMerge.Execute so I quit using that and managed to find a work around, but UpdateFields appears to be the only way to update the TOC.
Hi
Thank you for additional information. You have the same problem with MailMerge.Execute because this method internally calls UpdateFields method.
Could you please attach your template and code that will allow us to reproduce the problem we will check the issue and provide you more information.
Best regards,
' Nothing Special
Private _ProposalTemplate As Document = Nothing
Protected Sub btnProposal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProposal.Click
Try
_ProposalTemplate = New Document(Server.MapPath("NDA_C6.docx"))
_ProposalTemplate.MailMerge.RemoveEmptyRegions = True
_ProposalTemplate.UpdateFields() ' Hangs Here
Dim fileName As String = FileHelper.CombinePathAndFile(Server.MapPath("~/DealClosing/temp"), FileHelper.GetRandomFileName(UserData.DealID(Session).ToString & "_Contract", "docx"))
' Delete if present
FileHelper.DeleteFileIfPresent(fileName)
_ProposalTemplate.Save(fileName)
_ProposalTemplate = Nothing
' Call to flush Word Doc
End Try
End Sub
Hi
Thank you for additional information. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.
Best regards,
Hi,
I am facing similar issue in my application. Is there any fix available to overcome this ?
Hi
Thanks for your request. Could you please attach your template and code here for testing? We will check the issue and provide you more information.
Best regards,
The issues you have found earlier (filed as WORDSNET-4729) have been fixed in this .NET update and in this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.