While converting xls to xlsx(input size >100mb), encounter content loss.
There are 2 sheets in the input file with 2nd sheet mainly pictures with different formats, eg borders, beveled oval. First sheet is ok but second sheet pictures from row 325 to row 1260 are lost. however wording at row 1261 is being captured.
Steps to Reproduce:
-
Prepare a MS excel of xls and xlsx, eg, example.xls / xlsx, minimally 100mb
-
convert it to example.converted.xlsx
Sample Input file
https://transfer.sh/XYwnS/100mb2.xls
Output file
https://transfer.sh/JcMAI/100MB_17.xlsx
Some code modification:
FileStream input_stream = new FileStream(input_file, FileMode.Open, FileAccess.Read);
Document doc = new Document(input_stream);
if (remove_macro) doc.RemoveMacros();
if (remove_ole) {
NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true);
foreach (Aspose.Words.Drawing.Shape shape in shapes)
{
if (shape.OleFormat != null) shape.Remove();
}
}
doc.Save(output_file);
input_stream.Close();
API Version:
image.png (6.6 KB)