Aspose.Slides for .NET v19.6发布上线!支持从演示文稿中提取VBA宏!

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

Aspose.Slides for .NET更新至v19.6,新增支持从演示文稿中提取VBA宏、为文本框设置锁定宽高比等多项功能!动画

【下载Aspose.Slides for .NET最新试用版】this

具体更新内容

key 概述 类别
SLIDESNET-40010 在图表中设置外部工做簿的外部工做簿路径 调查
SLIDESNET-41093 将演示文稿另存为内存流问题 调查
SLIDESNET-40958 新增将演示文稿另存为HTML时,使每一个页面都自给自足的选项 新功能
SLIDESNET-40672 支持从演示文稿中提取VBA宏 新功能
SLIDESNET-34681 支持PDF转换百分比的进展 新功能
SLIDESNET-41101 实现PDF转换百分比的进度 新功能
SLIDESNET-41142 支持设置锁定长宽比的文本框 新功能
SLIDESNET-41092 IColorFormat.Color不返回有效颜色 新功能
SLIDESNET-31569 在PowerPoint图表中添加自定义行 新功能
SLIDESNET-30385 使用编辑数据自动刷新图表 新功能
SLIDESNET-16733 Fusion Asrts支持Aspose.Slides 新功能
SLIDESNET-18215 支持Aspose.Slides中的ComponentArt图表对象 新功能
SLIDESNET-12438 SmartArt和图表对象实现PPTX -> PDF 加强
SLIDESNET-41149 生成框和晶须图表 加强
SLIDESNET-41090 PPTX文件未正确转换为PDF Bug修复

更多更新细则请参考:【Aspose.Slides for .NET v19.6更新说明】spa

 

Aspose.Slides for .NET v19.6的API更改


▲添加了BackgroundEffectiveData类和IBackgroundEffectiveData接口code

已经添加了Aspose.Slides.IBackgroundEffectiveData接口和Aspose.Slides.BackgroundEffectiveData类的实现。它们表明幻灯片的有效背景,包含有效填充格式和有效效果格式的信息。orm

▲添加了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);
         }
     }
}

ASPOSE技术交流QQ群(642018183)已开通,各种资源及时分享,欢迎交流讨论!

相关文章
相关标签/搜索