Aspose.Slides for .NET是一个独特的演示处理API,它允许应用程序读取、写入、修改和转换PowerPoint演示文稿。作为一个独立的API,它提供了管理PowerPoint关键功能的功能,如管理文本、形状、表格和动画、向幻灯片添加音频和视频、预览幻灯片等,而不需要Microsoft PowerPoint。

Aspose.Slides for .NET迎来2020年9月更新v20.9,实现自主的跨平台3D引擎,在SVG中生成支持单个tspan的Id属性,修复保存.ppt文件时发生异常等诸多问题。(下载最新版,安装包仅提供部分功能,并设置限制,如需试用完整功能请申请免费授权)

具体更新内容

key 概述 类别
SLIDESNET-42081 在SVG中生成支持单个tspan的Id属性 增强功能
SLIDESNET-42123 保存.ppt文件时发生异常 Bug修复
SLIDESNET-42117 音频帧未通过VideoPlayerHtmlController导出为HTML Bug修复
SLIDESNET-42111 导出的PDF中缺少文本 Bug修复
SLIDESNET-42098 使用空数据生成树图图表的操作不正确。 Bug修复
SLIDESNET-42096 将生成的缩略图中的形状滑动为空 Bug修复
SLIDESNET-42094 组形状WriteAsSvg()-旋转丢失 Bug修复

公共API更改

添加3D支持

在Aspose.Slides 20.9 中宣布了自己的跨平台3D引擎。新的3D引擎可以导出和栅格化具有3D效果的形状和文本。

在以前的版本中,已应用3D效果的“幻灯片”形状被渲染为平坦。但是,现在可以使用成熟的3D渲染形状。此外,现在可以通过Slides公共API创建具有3D效果的形状:

using (Presentation pres = new Presentation())
{IAutoShape shape = pres.Slides[0].Shapes.AddAutoShape(ShapeType.Rectangle, 200, 150, 200, 200);shape.TextFrame.Text = "3D";shape.TextFrame.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontHeight = 64;shape.ThreeDFormat.Camera.CameraType = CameraPresetType.OrthographicFront;shape.ThreeDFormat.Camera.SetRotation(20, 30, 40);shape.ThreeDFormat.LightRig.LightType = LightRigPresetType.Flat;shape.ThreeDFormat.LightRig.Direction = LightingDirection.Top;shape.ThreeDFormat.Material = MaterialPresetType.Powder; shape.ThreeDFormat.ExtrusionHeight = 100;shape.ThreeDFormat.ExtrusionColor.Color = Color.Blue;pres.Slides[0].GetThumbnail(2, 2).Save("sample_3d.png");pres.Save("sandbox_3d.pptx", SaveFormat.Pptx);
}

渲染的缩略图如下所示:

添加IBulletFormatEffectiveData.FillFormat属性

新的FillFormat属性已添加到IBulletFormatEffectiveData接口。使用此属性可以获取段落项目符号填充的有效值。

下面的代码段演示了如何检索项目符号的填充有效数据:

using (Presentation pres = new Presentation("SomePresentation.pptx"))
{// Assume that the first shape on the first slide is AutoShape with some text...// Output information about text paragraphs' bulletsAutoShape autoShape = (AutoShape)pres.Slides[0].Shapes[0];foreach (Paragraph para in autoShape.TextFrame.Paragraphs){IBulletFormatEffectiveData bulletFormatEffective = para.ParagraphFormat.Bullet.GetEffective();Console.WriteLine("Bullet type: " + bulletFormatEffective.Type);if (bulletFormatEffective.Type != BulletType.None){Console.WriteLine("Bullet fill type: " + bulletFormatEffective.FillFormat.FillType);switch (bulletFormatEffective.FillFormat.FillType){case FillType.Solid:Console.WriteLine("Solid fill color: " + bulletFormatEffective.FillFormat.SolidFillColor);break;case FillType.Gradient:Console.WriteLine("Gradient stops count: " + bulletFormatEffective.FillFormat.GradientFormat.GradientStops.Count);foreach (IGradientStopEffectiveData gradStop in bulletFormatEffective.FillFormat.GradientFormat.GradientStops)Console.WriteLine(gradStop.Position + ": " + gradStop.Color);break;case FillType.Pattern:Console.WriteLine("Pattern style: " + bulletFormatEffective.FillFormat.PatternFormat.PatternStyle);Console.WriteLine("Fore color: " + bulletFormatEffective.FillFormat.PatternFormat.ForeColor);Console.WriteLine("Back color: " + bulletFormatEffective.FillFormat.PatternFormat.BackColor);break;}}Console.WriteLine();}
}

Aspose.Slides.Export.Web成员应用程序示例

下面的代码示例演示了Aspose.Slides.Export.Web成员的实际应用。它代表Presentation类的扩展,该扩展创建并设置一个WebDocument对象,该对象将演示文稿保存为HTML。请注意,转换模板未包含在示例中。

public static class PresentationExtensions
{public static WebDocument ToSinglePageWebDocument(this Presentation pres,WebDocumentOptions options,string templatesPath,string outputPath){WebDocument document = new WebDocument(options);SetGlobals(document, options, outputPath);document.Global.Put("slidesPath", outputPath);document.Global.Put("stylesPath", outputPath);document.AddCommonInputOutput(options, templatesPath, outputPath, pres);return document;}private static void SetGlobals(WebDocument document, WebDocumentOptions options, string outputPath){string imagesPath = Path.Combine(outputPath, "images");string fontsPath = Path.Combine(outputPath, "fonts");string mediaPath = Path.Combine(outputPath, "media");document.Global.Put("slideMargin", 10);document.Global.Put("embedImages", options.EmbedImages);document.Global.Put("imagesPath", imagesPath);document.Global.Put("fontsPath", fontsPath);document.Global.Put("mediaPath", mediaPath);}private static void AddCommonInputOutput(this WebDocument document, WebDocumentOptions options, string templatesPath, string outputPath, Presentation pres){string stylesPath = document.Global.Get<string>("stylesPath");document.Input.AddTemplate<Presentation>("styles-pres", Path.Combine(templatesPath, @"styles\pres.css"));document.Input.AddTemplate<MasterSlide>("styles-master", Path.Combine(templatesPath, @"styles\master.css"));document.Input.AddTemplate<Presentation>("index", Path.Combine(templatesPath, "index.html"));document.Input.AddTemplate<Slide>("slide", Path.Combine(templatesPath, "slide.html"));document.Input.AddTemplate<AutoShape>("autoshape", Path.Combine(templatesPath, "autoshape.html"));document.Input.AddTemplate<TextFrame>("textframe", Path.Combine(templatesPath, "textframe.html"));document.Input.AddTemplate<Paragraph>("paragraph", Path.Combine(templatesPath, "paragraph.html"));document.Input.AddTemplate<Paragraph>("bullet", Path.Combine(templatesPath, "bullet.html"));document.Input.AddTemplate<Portion>("portion", Path.Combine(templatesPath, "portion.html"));document.Input.AddTemplate<VideoFrame>("videoframe", Path.Combine(templatesPath, "videoframe.html"));document.Input.AddTemplate<PictureFrame>("pictureframe", Path.Combine(templatesPath, "pictureframe.html"));document.Input.AddTemplate<Table>("table", Path.Combine(templatesPath, "table.html"));document.Input.AddTemplate<Shape>("shape", Path.Combine(templatesPath, "shape.html"));document.Output.Add(Path.Combine(outputPath, "index.html"), "index", pres);document.Output.Add(Path.Combine(stylesPath, "pres.css"), "styles-pres", pres);document.Output.Add(Path.Combine(stylesPath, "master.css"), "styles-master", (MasterSlide)pres.Masters[0]);if (!options.EmbedImages){string imagesPath = document.Global.Get<string>("imagesPath");document.AddImagesOutput(imagesPath, pres);}}private static void AddImagesOutput(this WebDocument document, string outputPath, Presentation pres){for (int index = 0; index < pres.Images.Count; index++){IPPImage image = pres.Images[index];string path;string ext;if (image.ContentType == "image/x-emf"|| image.ContentType == "image/x-wmf") //save metafile as PNG to make it supported by various browsers  {ext = "png";path = Path.Combine(outputPath, string.Format("image{0}.{1}", index, ext));var bitmap = ImageHelper.MetafileToBitmap(image);document.Output.Add(path, new ThumbnailOutputFile(bitmap), image);continue;}ext = MimeTypesMap.GetExtension(image.ContentType);path = Path.Combine(outputPath, string.Format("image{0}.{1}", index, ext));document.Output.Add(path, image);}}
}

如果您有任何疑问或需求,请随时加入Aspose技术交流群(642018183),我们很高兴为您提供查询和咨询

PPT处理福音!Aspose.Slides最新版实现自主的跨平台3D引擎相关推荐

  1. Aspose.Slides 21.11.0 For .NET Crack

    适用于 .NET 的 Aspose.Slides 用于 PowerPoint 文件格式的 .NET API 在 .NET C# 中读取.写入.修改.合并.克隆.保护和转换 PowerPoint 和 O ...

  2. 想在Java中把PPT转化为PDF吗?教你用Aspose.Slides轻松搞定!

    PDF已成为最广泛和最常用的数字文档格式.由于PDF格式具有固定的布局,因此大多数文档在共享之前都已转换为PDF. 在将各种文档转换为PDF格式的过程中,PPT到PDF的转换是一种流行的用例,且非常的 ...

  3. 【更新】PPT管理控件Aspose.Slides V17.5发布 | 附下载

    2019独角兽企业重金招聘Python工程师标准>>> Aspose.Slides for .NET 17.5 功能和改进 核心 概述 类别 SLIDESNET-38576 生成的S ...

  4. PPT开发控件 Aspose.Slides for Java 授权须知

    Aspose.Slides是一款用于生成,管理和转换PowerPoint幻灯片的本机API,可以使用多种格式,而不需要Microsoft PowerPoint.并且可在任何平台上操作PowerPoin ...

  5. PPT文档管理控件Aspose.Slides v19.5上线发布!开始评估PDF转换的时间花费!

    Aspose.Slides for .NET一种独特的表示处理API,使应用程序能够读取,编写,修改和转换PowerPoint演示文稿.支持大多数Microsoft PowerPoint格式进行处理和 ...

  6. PPT处理控件Aspose.Slides功能演示:使用 C# 在 PowerPoint 演示文稿中创建 SmartArt

    演示文稿中的 SmartArt 用于以视觉形式提供信息.有时,选择使简单的文本更具吸引力.而在其他情况下,它用于演示流程图.流程.不同实体之间的关系等.下面将介绍如何使用 C# 以编程方式在 Powe ...

  7. 【版本更新】Aspose.Slides V17.10发布 | 支持免费下载

    2019独角兽企业重金招聘Python工程师标准>>> Aspose.Slides for .NET 17.10 更新 85折限时优惠 功能和改进 核心 概述 类别 SLIDESNE ...

  8. Aspose.Slides for Java 3.0 发布

    Aspose.Slides for Java 3.0 发布,主要改进包括: 幻灯片打印 图表渲染 SmartArt 渲染 PPT/ODT 转 PPTX 导出幻灯片到 HTML 支持 OOXML 另外从 ...

  9. Aspose.Slides使用教程:使用 C++ 访问或修改 PowerPoint 文件的属性

    PowerPoint 文件包含提供有关演示文稿的附加信息的元数据或文档属性.其中包括演示文稿的标题.日期.作者等信息.在本文中,将学习 如何使用 C++ 访问和修改 PowerPoint 演示文稿中的 ...

最新文章

  1. Tomcat5.5x+jndi配置
  2. CentOS7.2中NFS1.3 安装
  3. pythonpil库过滤图像contour_快乐python 零基础也能P图 —— PIL库
  4. 搞定Linux只要半年
  5. 参数处理:#{}与${}取值的区别
  6. HighNewTech—AI界消息:2019年3月,贾扬清(Caffe框架作者)被曝从Facebook离职,入职Alibaba硅谷研究院
  7. 基于JQuery实现滚动到页面底端时自动加载更多信息
  8. 修改软件许可证使用时间_阮一峰:为什么开源数据库改变许可证?
  9. http响应头中X-Frame-Options的作用及危害
  10. linux whois 命令 详解
  11. atitit.提升开发效率---MDA 软件开发方式的革命(3)----自动化建表
  12. 好用的android高清播放器,高清播放器哪个好用(推荐4款4K高清画质播放器)
  13. 基于脉振高频电压信号注入法的PMSM无位置传感器控制原理和仿真
  14. word中快速确认字体颜色的方法
  15. 小米投资美的,互联网进入鲨鱼吃鲨鱼阶段
  16. 牛客练习赛87 -A-中位数
  17. python之pip安装第三方库
  18. 医学序列图像定位线绘制基本方法介绍
  19. 第 4 章 HBase 进阶
  20. TNT-Transformer in Transformer

热门文章

  1. Android 仿照微信查看大图
  2. android4.2屏幕录像,android——使用自带录屏工具进行屏幕录像
  3. mysql取当前月份两位数_SQL获取当前时间月份为两位数
  4. 国外注册的域名要不要备案?
  5. 《操作系统导论》学习笔记(六):逻辑地址空间管理
  6. 模型推荐丨新闻传播大数据项目案例模型分享
  7. 巴西柔术第三课:封闭式防守的降服技术
  8. android 强制开启wifi,强制Android使用无网络的Wifi网络
  9. 6个Excel操作技巧,期待明年更好的自己
  10. 【电力电子技术】 THE BUCK-BOOST 升降压斩波电路