Spire.Presentation 9.3.4 已发布。该版本新增 SaveToSvgOption 用于设置 PPTX 转 Svg 的转换选项,同时也支持获取 PPT 默认字体样式。除此之外,一些在转换 PPTX 到 PDF/SVG 以及加载、保存文档时出现的问题也得以成功解决。详情见下文。
新功能:
- 支持获取 PPT 默认字体样式。
- 新增 SaveToSvgOption 用于设置 PPTX 转 Svg 的转化选项。
- 在 ILayout 类中新增属性用于显示背景形状
Presentation presentation = new Presentation();
presentation.LoadFromFile(inputFile);
IAutoShape shape = presentation.Slides[0].Shapes[0] as IAutoShape;
DefaultTextRangeProperties format = shape.TextFrame.Paragraphs[0].TextRanges[0].DisPlayFormat;
File.AppendAllText(outputFile, "text :" + shape.TextFrame.Paragraphs[0].TextRanges[0].Text + "\r\n");
File.AppendAllText(outputFile, "is bold :" + format.IsBold + "\r\n");
File.AppendAllText(outputFile, "is italic :" + format.IsItalic + "\r\n");
Presentation ppt = new Presentation();
ppt.LoadFromFile(inputFile);
ppt.SaveToSvgOption.SaveUnderlineAsDecoration = true;
byte[] svgByte = ppt.Slides[0].Shapes[0].SaveAsSvgInSlide();
FileStream fs = new FileStream(outputFile + "1.svg", FileMode.Create);
fs.Write(svgByte, 0, svgByte.Length);
fs.Close();
Presentation presentation = new Presentation();
presentation.LoadFromFile(@"in.pptx");
bool showMasterShape = presentation.Slides[1].Layout.ShowMasterShapes;
问题修复:
- 修复了 PPTX 转 SVG 渐变色不正确的问题。
- 修复了 PPTX 转 PDF 图片质量降低的问题。
- 修复了形状转 SVG 文本空格丢失的问题。
- 修复了加载保存 PPTX 文档内容不正确的问题。
获取 Spire.Presentation 9.3.4,请点击:
https://www.e-iceblue.cn/Downloads/Spire-Presentation-NET.html