I use Aspose.Cells to convert Excel files to HTML.
HTML is significantly increased in size compared to the original document () example.zip (2.0 MB) image.png (9.6 KB)
I found that Aspose duplicates styles for the td in HTML, which can lead to an increase in size. image.png (4.5 KB)
I believe that optimization is needed here.
Probably the CSS class should be generated and used in places with the same styling.
I have a 10MB Excel document that is 300MB after conversion.
Please notice, I am able to reproduce the issue as you mentioned by converting your template file to HTML file format. I found that file size (“sheet001.htm”) is somehow increased in Excel to HTML conversion.
e.g. Sample code:
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook("e:\\test2\\example.xlsx");
foreach (Worksheet sheet in workbook.Worksheets)
{
sheet.Cells.DeleteBlankColumns();
sheet.Cells.DeleteBlankRows();
}
HtmlSaveOptions options = new HtmlSaveOptions();
options.ExportHiddenWorksheet = false;
options.ExcludeUnusedStyles = true;
workbook.Save("e:\\test2\\out1.html", options);
I have logged a ticket with an id “CELLSNET-49377” for your issue. We will look into it soon.
Once we have an update on it, we will let you know.
When saving the file as HTML with MS Excel, the size of sheet001.htm is also greater than 70M. We found there are many empty cells in the HTML file. Now, please try the following code to merge empty cells to minimize the size:
As we told you, when saving the file as HTML using MS Excel, the size of sheet001.htm is also greater than 70M. We found there are many empty cells in the HTML file. As devised, please try the suggested code (in the previous post) to merge empty cells to minimize the size for your needs.
Please follow up other thread to get latest updates or for a fix.