Hi,
We are using licensed version of Aspose Air, I am trying to convert .xls file to HTML file. File got converrted properly, but the image embedded in .xls document get duplicated and two images are getting added in HTML generated. However .xls file has only one image. We are using Aspose cells version 7.3.3.4 .
Following code I am using,
Workbook workbook = new Workbook(inputBlobStream);
Workbook destWorkbook = new Workbook();
Worksheet destSheet = destWorkbook.Worksheets[0];
int totalRowCount = 0;
for (int i = 0; i < workbook.Worksheets.Count; i++)
{
Worksheet sourceSheet = workbook.Worksheets[i];
Aspose.Cells.Range sourceRange = sourceSheet.Cells.MaxDisplayRange;
Aspose.Cells.Range destRange = destSheet.Cells.CreateRange(sourceRange.FirstRow + totalRowCount, sourceRange.FirstColumn, sourceRange.RowCount,
sourceRange.ColumnCount);
destRange.Copy(sourceRange);
totalRowCount = sourceRange.RowCount + totalRowCount;
}
destWorkbook.Worksheets[0].AutoFitColumns();
destWorkbook.Save(localStorageHtmlFilePath, Aspose.Cells.SaveFormat.Html);
Attached is the file I am trying to convert using Aspose. Please let me know if I missed anything.
Thank you !
Abhijeet
Hi Abhijeet,
Thanks for your inquiry. As your query is related to Aspose.Cells, I will move your request in Aspose.Cells forum. My colleagues from Aspose.Cells component team will answer you shortly.
Best regards,
Hi,
I have tested with it and there looks to me no issue. there is no duplicate image in it.
As you have added a line i.e. to your code:
“destWorkbook.Worksheets[0].AutoFitColumns();”
so your contents or image will be deteriorated, If you need to have same look and feel as per Excel template file (viewing in MS Excel), you may skip this line.
If you still have any issue, let us know with some screen shots and provide more details about the issue, we will check it soon.
Thank you.
Thank you for providing guidlines, I verified issue with vesion Aspose cell 7.3.4.2, Yet it is reproducible with this version also.
Here the crux is when we look converted document as HTML we can see only one image attached in Preview mode. But as we open the document in Editor, two image tags are added for the same image. Attached are the screen prints details as per request.
Please verify it and let me know if it is recreated the same way.
Thank you !
Abhijeet
Hi,
Thanks for providing further details.
I found the reason why there are two
tags rendered for the output HTML file. Actually there are two pictures (duplicate - both are placed one above other) and not one in the source file, see the screen shot here. So, it is not an issue with our product.
Thank you.