Spire.Presentation 10.4.6 supports inserting formulas in table cells

Spire.Presentation 10.4.6 supports inserting formulas in table cells

2025-04-27 08:06:35

We're glad to announce the release of Spire.Presentation 10.4.6. This version supports inserting formulas in table cells and reading CustomerData of Shape. In addition, some issues that occurred when converting PPTX to PDF/SVG and opening PowerPoint files have been successfully fixed. Check below for more details.

Here is a list of all changes made in this release.

Category ID Description
New feature SPIREPPT-2772 Supports reading CustomerData of Shape.
Presentation ppt = new Presentation();
ppt.LoadFromFile(inputFile);
List dataList = ppt.Slides[0].Shapes[1].CustomerDataList;
Console.WriteLine(dataList.Count);
for(int i = 0; i < dataList.Count; i++)
{
   string name = dataList[i].Name;
   string content = dataList[i].XML;
    File.WriteAllText(outputFile + name, content);

}
New feature SPIREPPT-2782 Supports inserting formulas in table cells.
//Create a PPT document
Presentation presentation = new Presentation();


Double[] widths = new double[] { 100, 100, 150, 100, 100 };
Double[] heights = new double[] { 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 };

//Add new table to PPT
ITable table = presentation.Slides[0].Shapes.AppendTable(presentation.SlideSize.Size.Width / 2 - 275, 90, widths, heights);

String[,] dataStr = new String[,]{
{"Name",    "Capital",  "Continent",    "Area", "Population"},
{"Venezuela",   "Caracas",  "South America",    "912047",   "19700000"},
{"Bolivia", "La Paz",   "South America",    "1098575",  "7300000"},
{"Brazil",  "Brasilia", "South America",    "8511196",  "150400000"},
{"Canada",  "Ottawa",   "North America",    "9976147",  "26500000"},
{"Chile",   "Santiago", "South America",    "756943",   "13200000"},
{"Colombia",    "Bagota",   "South America",    "1138907",  "33000000"},
{"Cuba",    "Havana",   "North America",    "114524",   "10600000"},
{"Ecuador", "Quito",    "South America",    "455502",   "10600000"},
{"Paraguay",    "Asuncion","South America", "406576",   "4660000"},
{"Peru",    "Lima", "South America",    "1285215",  "21600000"},
{"Jamaica", "Kingston", "North America",    "11424",    "2500000"},
{"Mexico",  "Mexico City",  "North America",    "1967180",  "88600000"}
};

//Add data to table
for (int i = 0; i < 13; i++)
    for (int j = 0; j < 5; j++)
    {
        //Fill the table with data
        table[j, i].TextFrame.Text = dataStr[i, j];

        //Set the Font
        table[j, i].TextFrame.Paragraphs[0].TextRanges[0].LatinFont = new TextFont("Arial Narrow");
    }

//Set the alignment of the first row to Center
for (int i = 0; i < 5; i++)
{
    table[i, 0].TextFrame.Paragraphs[0].Alignment = TextAlignmentType.Center;
}
string latexMathCode = @"x^{2}+\sqrt{x^{2}+1}=2";
table[2, 3].TextFrame.Paragraphs.AddParagraphFromLatexMathCode(latexMathCode);
//Set the style of table
table.StylePreset = TableStylePreset.LightStyle3Accent1;

//Save the document
presentation.SaveToFile("Output.pptx", FileFormat.Pptx2010);
Bug SPIREPPT-2421 Fixes the issue where the text was garbled when converting PowerPoint to PDF.
Bug SPIREPPT-2691 Fixes the issue that the application threw a "System.NullReferenceException" error when adding a GroupShape to a new PowerPoint file.
Bug SPIREPPT-2798 Fixes the issue where the text was lost when converting PowerPoint to PDF.
Bug SPIREPPT-2804 Fixes the issue where opening a file saved using the Presentation.GetStream() method would cause an error.
Bug SPIREPPT-2824 Fixes the issue where the position of shapes changed after using the Ungroup() method.
Bug SPIREPPT-2840 Fixes the issue that the application threw a "NullReferenceException" error when converting PowerPoint to SVG.
Bug SPIREPPT-2851 Fixes the issue where the shapes were incorrect when converting PowerPoint to SVG.
Click the link to download Spire.Presentation 10.4.6:
More information of Spire.Presentation new release or hotfix: