Spire.Presentation 10.3 已发布。本次更新支持保存母版幻灯片中的图片为 SVG,同时增强了形状到 SVG 的转换功能。此外,一些已知问题也在该版本中成功修复,如设置 TextAutofitType.Shape 不生效的问题。详情请阅读以下内容。
新功能:
- 支持保存母版中的图片为 SVG。
Presentation ppt = new Presentation();
ppt.LoadFromFile(inputFile);
int num = 1;
IMasterSlide masterSlide = ppt.Masters[0];
for (int i = 0; i < masterSlide.Shapes.Count; i++)
{
IShape s = masterSlide.Shapes[i];
if (s is SlidePicture)
{
SlidePicture ps = s as SlidePicture;
byte[] svgByte = s.SaveAsSvgInSlide();
FileStream fs = new FileStream(outputFile +num + ".svg", FileMode.Create);
fs.Write(svgByte, 0, svgByte.Length);
fs.Close();
num++;
}
}
问题修复:
- 修复了设置 TextAutofitType.Shape 不生效的问题。
- 修复了使用 Shapes.AppendShapeConnector 效果不正确的问题。
- 修复了获取不到 PPT 文档 shape 和 image 的链接的问题。
- 修复了转 shape 到 svg,报 InvalidCastException 的问题。
- 修复了加载 PPTX 文档,程序抛 "Property not found" 的问题。
获取 Spire.Presentation 10.3,请点击:
https://www.e-iceblue.cn/Downloads/Spire-Presentation-NET.html