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

Free Support Forum - aspose.com

Document size increasing exponentially when using Aspose Words

Hi,
I have an application where I get a report from database, make changes in my application and saving the compressed report back to database. If I want to open the report again I get it from database and un-compress it and export it to a file.

The issue I have is, when working with the report I use Aspose words Document to keep track of the changes and finally save it. In some cases when I convert the report data stream to Aspose.Words Document and save it, the size of the file is increases exponentially. So when i save this report (after compressing) to the database I am storing the large size file data. This becomes a problem when I try to uncompress the report data, I get insufficient buffer size error.

Whey is the size of the file increasing only in certain cases. How can I prevent this so that I do not have any problem with compressing and uncompressing the data.

I created a sample project with steps that cause the uncompress to fail. I included 2 files in the project, 1 with small size increase and other with exponential size increase.

The sample project can be found

Please advise the best approach for resolving this issue.

Thank you,
Mahita

@andem,

Thanks for your inquiry. 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-15667. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@andem,

Thanks for your patience. It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-15667) as ‘Not a Bug’.

You are facing this issue due to embedded image in your document. We suggest you please set the value of RtfSaveOptions.ExportImagesForOldReaders property as false in your code.

Aspose.Words.Saving.RtfSaveOptions rtfSo = new Aspose.Words.Saving.RtfSaveOptions();
rtfSo.ExportImagesForOldReaders = false;

This property specifies whether the keywords for “old readers” are written to RTF or not. This can significantly affect the size of the RTF document. Default value is true.

“Old readers” are pre-Microsoft Word 97 applications and also WordPad. When this option is true Aspose.Words writes additional RTF keywords. These keywords allow the document to be displayed correctly when opened in an “old reader” application, but can significantly increase the size of the document. If you set this option to false, then only images in WMF, EMF and BMP formats will be displayed in “old readers”.