After we moved to the new table engine (.Net) I came across the following issue.
If we try to delete a column from a table in a powerpoint slide it throws an exception
"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index".
This error occurs for any given index. However if we add an extra coulmn using Aspose method "AddColumn" then we can delete just one column (any column) from the table. However if we add two columns using "AddColumn" then again the above exception occurs.
Try this code against a ppt file that has a table in the first slide and it will throw an exception
string templateFilePath = @"C:\test.ppt"; Presentation _presentation; _presentation = new Presentation(templateFilePath); Slide sd = _presentation.GetSlideByPosition(1); for (int j = 0; j < sd.Shapes.Count; j++) { Shape sh = sd.Shapes[j]; if (sh.GetType() == typeof(Table)) { Table sht = (Table)sh; sht.DeleteColumn(0); } }
Now Replace the for loopabove with this and it will work
for (int j = 0; j < sd.Shapes.Count; j++) { Shape sh = sd.Shapes[j]; if (sh.GetType() == typeof(Table)) { Table sht = (Table)sh; sht.AddColumn(); sht.DeleteColumn(0); } }
Now replace the for loop with this and it will again throw an exception.
for (int j = 0; j < sd.Shapes.Count; j++) { Shape sh = sd.Shapes[j]; if (sh.GetType() == typeof(Table)) { Table sht = (Table)sh; sht.AddColumn(); sht.DeleteColumn(0); sht.DeleteColumn(0); } }
Make sure you use latest version and don’t have old one somewhere in the cache. If problem still there please provide presentation example to reproduce the problem.
Can you give me a date by which this bug will be resolved? We have already used your new version in our product but because of this bug we are not able to release our new version. Your answer should help me decide whther to rollback the new aspose changes and use the old aspose instead or to wait till you fix this bug.