网站首页 > 博客文章 正文
Aspose.Slides for .NET是一个独特的演示处理API,它允许应用程序读取、写入、修改和转换PowerPoint演示文稿。作为一个独立的API,它提供了管理PowerPoint关键功能的功能,如管理文本、形状、表格和动画、向幻灯片添加音频和视频、预览幻灯片等,而不需要Microsoft PowerPoint。
Aspose.Slides for .NET更新至v19.6,新增支持从演示文稿中提取VBA宏、为文本框设置锁定宽高比等多项功能!
Aspose.Slides for .NET v19.6的API更改
▲添加了BackgroundEffectiveData类和IBackgroundEffectiveData接口
已经添加了Aspose.Slides.IBackgroundEffectiveData接口和Aspose.Slides.BackgroundEffectiveData类的实现。它们代表幻灯片的有效背景,包含有效填充格式和有效效果格式的信息。
▲添加了IBaseSlide.CreateBackgroundEffective方法
CreateBackgroundEffective方法已添加到IBaseSlide接口和BaseSlide类中。使用此方法可以获得幻灯片背景的有效值。
以下示例代码输出有效的背景填充:
Presentation pres = new Presentation( "SamplePresentation.pptx" ); IBackgroundEffectiveData effBackground = pres.Slides[ 0 ].CreateBackgroundEffective(); if (effBackground.FillFormat.FillType == FillType.Solid) Console.WriteLine( "Fill color: " + effBackground.FillFormat.SolidFillColor); else Console.WriteLine( "Fill type: " + effBackground.FillFormat.FillType);
▲添加了新的IProgressCallback接口
新的IProgressCallback接口已添加到ISaveOptions接口和SaveOptions抽象类中。IProgressCallback接口表示用于以百分比保存进度更新的回调对象。
以下示例代码输出有效的背景填充:
public interface IProgressCallback { ////// Reports a progress update. //////A value of the updated progress.void Reporting(double progressValue); }
下面的代码片段显示了如何使用IProgressCallback接口:
using (Presentation presentation = new Presentation(fileName)) { ISaveOptions saveOptions = new PdfOptions(); saveOptions.ProgressCallback = new ExportProgressHandler(); presentation.Save(pdfFileName, SaveFormat.Pdf, saveOptions); }
class ExportProgressHandler : IProgressCallback { public void Reporting(double progressValue) { // Use progress percentage value here } }
▲Pot值已添加到LoadFormat和SaveFormat枚举中
新的Pot值已添加到Aspose.Slides.LoadFormat和Aspose.Slides.SaveFormat枚举中。此值表示Microsoft PowerPoint 97-2003演示文稿模板格式。
▲增加了对作为BLOB的管理映像的支持
从版本19.6开始,Aspose.Slides支持将演示图像作为BLOB进行管理。此外,新方法已添加到IImageCollection接口和ImageCollection类,以支持将大图像添加为流以将它们视为BLOB:
IPPImage AddImage(Stream stream,LoadingStreamBehavior loadingStreamBehavior);
此示例演示如何包含大型BLOB(图像)并防止高内存消耗。
static void AddingNewBlobImageToPresentation() { // supposed we have the large image file we want to include into the presentation const string pathToLargeImage = "largeImage.png" ; // create a new presentation which will contain this image using (Presentation pres = new Presentation()) { using (FileStream fileStream = new FileStream(pathToLargeImage, FileMode.Open)) { // let's add the image to the presentation - we choose KeepLocked behavior, because we not // have an intent to access the "largeImage.png" file. IPPImage img = pres.Images.AddImage(fileStream, LoadingStreamBehavior.KeepLocked); pres.Slides[ 0 ].Shapes.AddPictureFrame(ShapeType.Rectangle, 0 , 0 , 300 , 200 , img); // save the presentation. Despite that the output presentation will be // large, the memory consumption will be low the whole lifetime of the pres object pres.Save( "presentationWithLargeImage.pptx" , SaveFormat.Pptx); } } }
获取更新详细说明或下载链接可点击下方“了解更多”查看
↓↓↓
猜你喜欢
- 2024-09-11 图像处理控件Aspose.Imaging v19.6新版亮点示例详解(1)
- 2024-09-11 Excel处理控件Aspose.Cells v20.3 Java&.NET语言开启3月新版功能
- 2024-09-11 你还在为PDF转Excel困扰吗?Aspose.PDF转换完整指南来啦
- 2024-09-11 PDL格式解决方案Aspose.Page重磅上新!两大格式功能助力文档管理
- 2024-09-11 安利!快速识别图像光学标识!Aspose.OMR助你获取图像中的数据
- 2024-09-11 常见的4种行业应用级条码及开发工具,你都知道吗?
- 2024-09-11 Aspose.Pdf最新版发布-格式转换更流畅
- 2024-09-11 灵活文档压缩存档操作控件Aspose.ZIP重磅上线!加密保护文件安全
- 2024-09-11 Aspose.Words for .NET使用教程(四):渲染和打印及文档内容功能
- 2024-09-11 支持OTF字体!PPT处理控件Aspose.Slides v20.6最新版增4大新功能
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- powershellfor (55)
- messagesource (56)
- aspose.pdf破解版 (56)
- promise.race (63)
- 2019cad序列号和密钥激活码 (62)
- window.performance (66)
- qt删除文件夹 (72)
- mysqlcaching_sha2_password (64)
- ubuntu升级gcc (58)
- nacos启动失败 (64)
- ssh-add (70)
- jwt漏洞 (58)
- macos14下载 (58)
- yarnnode (62)
- abstractqueuedsynchronizer (64)
- source~/.bashrc没有那个文件或目录 (65)
- springboot整合activiti工作流 (70)
- jmeter插件下载 (61)
- 抓包分析 (60)
- idea创建mavenweb项目 (65)
- vue回到顶部 (57)
- qcombobox样式表 (68)
- vue数组concat (56)
- tomcatundertow (58)
- pastemac (61)
本文暂时没有评论,来添加一个吧(●'◡'●)