Word export file very large for the amount of data

I am generating a word document from regular texts and HTMLs with CSS formatting. The generated file is very large for the amount of data. I copy and pest the generated data to a new word document and I get very smaller size that the one generated. Why is the file size very large? Is there a way to reduce the size?
E.g - Generated file -> 6,655 KB
- Copied file with the same data -> 35 KB

@tesfayemissy

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please attach the expected output Word file that shows the desired behavior.
  • Please create a standalone console application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.