We’re using aspose to implement a server side mail merge in our product. When we do a merge we append all merged data (1 doc per record) into a final doc so it can be opened and printed off. So obviously we’re prone to out of memory errors with this approach (bur we must produce 1 document with all merged records – business rules), We can check the memory after each append so we only keep appending if there is enough memory left.
Then when saving the file to disk we set the ‘TempFolder’ on the saveoption so it should use the temp folder rather than memory for saving. Is there a way to calculate how much memory the save still needs when using the temp folder? I appreciate it really depends on the data and the document itself but if you have any guideline it would be greatly appreciated.
Thanks,
Eamonn
This message was posted using Email2Forum by aske012.
Please note that the temp folder currently only takes affect when saving in the DOC format, it is not used for the other formats yet. Therefore if you are saving in another format such as DOCX then this would be the reason for OutOfMemory exception.
If you are saving as DOC then optimally you shouldn’t run into an exception during save. Please clarify if this is the case.
I’m afraid there is no direct way to find how much memory is still required. However you could gather a general indication of how much space a save would require by saving a fragment of the document (one of the parts that are appended) and seeing how large the output is. If you multiply this by the number of documents appended this would give a general indication of how much space is required.
If we can help you with anything else, please feel free to ask.
I have some news about your issue. During some testing I happened to find that this functionality is already available in Aspose.Words 11.1.0. It seems it was silently added to a recent version without any formal feature tracking.
Please try setting this temporary folder when exporting to DOCX and inform me of how it goes. I apologise for the delay that there was informing both of you about this option.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.