今天,我们发布了Spire.Presentation 4.8.5。该版本支持插入图片和视频到占位符,支持设置圆角矩形的半径,支持获取指定幻灯片的模板名字。此外,本次更新也修复了加载和转换PowerPoint文档出现的问题。更多详情如下。
新功能:
- 支持插入图片和视频到占位符。
Presentation ppt = new Presentation();
ppt.LoadFromFile("test.pptx");
for (int j=0;j < ppt.Slides.Count;j++)
{
ISlide slide = (ISlide)ppt.Slides[j];
for (int i=0;i < slide.Shapes.Count;i++)
{
Shape shape = (Shape)slide.Shapes[i];
switch(shape.Placeholder.Type)
{
case PlaceholderType.Media:
shape.InsertVideo("Video.mp4");
break;
case PlaceholderType.Picture:
shape.InsertPicture("Logo.png");
break;
case PlaceholderType.Chart:
shape.InsertChart(ChartType.ColumnClustered);
break;
case PlaceholderType.Table:
shape.InsertTable(3,2);
break;
case PlaceholderType.Diagram:
shape.InsertSmartArt(SmartArtLayoutType.BasicBlockList);
break;
}
}
}
Presentation presentation = new Presentation();
presentation.Slides[0].Shapes.InsertRoundRectangle(0, 60, 90, 100, 200, 36);
presentation.Slides[0].Shapes.AppendRoundRectangle(60, 290, 100, 200, 50);
presentation.SaveToFile("result.pdf", FileFormat.PDF);
presentation.SaveToFile("result.pptx", FileFormat.Pptx2013);
Presentation presentation = new Presentation();
presentation.LoadFromFile(file);
for (int i = 0; i < presentation.Slides.Count;i++ )
{
string name = presentation.Slides[i].Layout.Name;
}
问题修复:
- 修复了将PPT转换为SVG的渐变色位置问题。
- 修复了加载文档抛异常问题。
- 修复了保存文档抛异常问题。
- 修复了将PPT转换为图片的内容格式混乱问题。
- 修复了将PPT转换为图像时的内容丢失问题。
- 修复了在Windows 10上保存PPT文件时速度慢的问题。
获取Spire.Presentation 4.8.5,请点击:
https://www.e-iceblue.cn/Downloads/Spire-Presentation-NET.html