Excel to HTML conversion performance. Too many generated images

Hello.

I use Aspose.Cells to convert Excel files to HTML.
Conversion of many images.zip (5.0 MB)
takes a lot of time because Aspose generates many Empty images on the disk (~53000).
Original file does not contain any images.

How to improve performance correctly in this case?
Should I use ExportImagesAsBase64 parameter?
Why are so many images created?

@Andrei86,

I tried opening the file into MS Excel and MS Excel takes some time to open into it, MS Excel becomes slow too. Also, when I tried to take the print preview of certain sheets, e.g. “ЗКО”, “Кызылорда”, etc., MS Excel prompts error messages sometime. Moreover, your last sheet “0” has nothing in it just unnecessary formatting.

Are those images related to last sheet “0”? You should remove it or hide it before rendering and then try your scenario.

If you still find the issue, kindly do share your sample code that you are using. We will check your issue soon.

I can’t remove any data from the Excel file because I use Aspose.Cells for conversion any Excel file provided by user.

I don’t see any links to these images inside the generated HTML.
Where are they used?

@Andrei86,

Please share your output HTML file to show those images. Also, if you could open your file into MS Excel manually (Click Home|Find & Select|Selection Pane…) select sheets (“ЗКО” and “Кызылорда”), there are lots of shapes (TextBoxes) there.

You are right. I found links to this images.
But I don’t understand what it is.
This is just empty/transparent image. I don’t’ understand where I can find these in Original file.
Thanks.

@Andrei86,

I think those shapes/links are present with (approx.) 0 (height/width), kind of hidden objects in the sheets.

What is the right way to behave in such cases?
Converting such documents is time consuming due to the large amount of disk I / O.

@Andrei86,

Maybe you could remove the shapes (e.g. Textboxes) from those sheets before rendering to HTML. See the following sample code if it makes any difference.
e.g.
Sample code:

.......
Worksheet sheet = workbook.Worksheets["ЗКО"];
Aspose.Cells.Drawing.ShapeCollection shapes = sheet.Shapes;
           
            for (int i = shapes.Count - 1; i >=0; i--)
            {
                
                   shapes.RemoveAt(i);

            }

@Andrei86,

We have logged a ticket with an id “CELLSNET-49413” for removing invisible shapes in HTML rendering. We will add HtmlSaveOptions.RemoveInvisibleShapes property to reduce the images in Excel to HTML conversion.

Once we have an update on it, we will let you know.

@Andrei86,

This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

Worksheet sheet = workbook.Worksheets[“ЗКО”];
Aspose.Cells.Drawing.ShapeCollection shapes = sheet.Shapes;

        for (int i = shapes.Count - 1; i >=0; i--)
        {
            
               shapes.RemoveAt(i);

        }

This code looks dangerous. Can I delete some shape from other files that should not be deleted? I don’t see any conditions for deleting shapes.

@Andrei86,

For your information, We already logged a ticket with an id “CELLSNET-49413” for removing invisible shapes in HTML rendering. We add HtmlSaveOptions.RemoveInvisibleShapes property to reduce the images in Excel to HTML conversion. Please stay tuned until the next fix is available for your testing. Once the new fix is published, you will use the new properly to cope with it and it will be safe.

Thanks. I’m waiting for the update.

@Andrei86,

Sure, we will post the fix in the next few days or so.

The issues you have found earlier (filed as CELLSNET-49413) have been fixed in this update. This message was posted using Bugs notification tool by simon.zhao