Aspose.Slides for .NET一种独特的表示处理API,使应用程序能够读取,编写,修改和转换PowerPoint演示文稿。支持大多数Microsoft PowerPoint格式进行处理和操作。此外,API提供了许多高级功能,例如打印和渲染演示幻灯片到固定布局格式,HTML和图像。

Aspose.Slides for .NET更新至v19.5,开始评估PDF转换的时间花费,新增支持将SVG图像转换为形状!

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

具体更新内容

key 概述 类别
SLIDESNET-41051 PDF转换的时间花费评估 调查
SLIDESNET-41059 Aspose.Slides for .NET:没有文本的形状的栅格化或矢量化 新功能
SLIDESNET-41015 通过API获取默认表格背景 新功能
SLIDESNET-40727 支持将SVG图像转换为形状 新功能
SLIDESNET-40856 支持Size表示气泡图的属性 新功能
SLIDESNET-40730 在Aspose.Slides中支持Office 365 新功能
SLIDESNET-40237 支持在生成的PPT中隐藏左侧幻灯片缩略图窗格 新功能
SLIDESNET-40870 支持Aspose.Slides中的评论回复 新功能
SLIDESNET-39057 支持设置图表外部数据源工作簿路径 新功能
SLIDESNET-40852 支持漏斗图和2D地图 新功能
SLIDESNET-41034 使用发言者备注进行渲染时,页码不正确 Bug修复
SLIDESNET-41049 OLE嵌入对象的图标在单击后更改 Bug修复

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

公共API更改


▲添加了IComment.ParentComment属性

新的属性ParentComment添加到IComment接口和Comment类中。它允许获取或设置父注释,从而以注释和回复的层次结构的形式创建对话框。

注意:如果设置ParentComment导致循环引用,则会抛出类型为PptxEditException的异常。

下面的代码段显示了添加一些注释和一些回复的示例:

using (Presentation pres =  new  Presentation())
{
     // Add comment
     ICommentAuthor author1 = pres.CommentAuthors.AddAuthor( "Author_1" "A.A." );
     IComment comment1 = author1.Comments.AddComment( "comment1" , pres.Slides[ 0 ],  new  PointF( 10 10 ), DateTime.Now);
   
     // Add reply for comment1
     ICommentAuthor author2 = pres.CommentAuthors.AddAuthor( "Autror_2" "B.B." );
     IComment reply1 = author2.Comments.AddComment( "reply 1 for comment 1" , pres.Slides[ 0 ],  new  PointF( 10 10 ), DateTime.Now);
     reply1.ParentComment = comment1;
   
     // Add reply for comment1
     IComment reply2 = author2.Comments.AddComment( "reply 2 for comment 1" , pres.Slides[ 0 ],  new  PointF( 10 10 ), DateTime.Now);
     reply2.ParentComment = comment1;
   
     // Add reply to reply
     IComment subReply = author1.Comments.AddComment( "subreply 3 for reply 2" , pres.Slides[ 0 ],  new  PointF( 10 10 ), DateTime.Now);
     subReply.ParentComment = reply2;
   
     IComment comment2 = author2.Comments.AddComment( "comment 2" , pres.Slides[ 0 ],  new  PointF( 10 10 ), DateTime.Now);
     IComment comment3 = author2.Comments.AddComment( "comment 3" , pres.Slides[ 0 ],  new  PointF( 10 10 ), DateTime.Now);
   
     IComment reply3 = author1.Comments.AddComment( "reply 4 for comment 3" , pres.Slides[ 0 ],  new  PointF( 10 10 ), DateTime.Now);
     reply3.ParentComment = comment3;
   
     // Display hierarchy on console
     ISlide slide = pres.Slides[ 0 ];
     var  comments = slide.GetSlideComments( null );
     for  ( int  i =  0 ; i < comments.Length; i++)
     {
         IComment comment = comments[i];
         while  (comment.ParentComment !=  null )
         {
             Console.Write( "\t" );
             comment = comment.ParentComment;
         }
   
         Console.Write( "{0} : {1}" , comments[i].Author.Name, comments[i].Text);
         Console.WriteLine();
     }
   
     // Remove comment1 and all its replies
     comment1.Remove();
}

▲添加了IViewProperties.NormalViewProperties,INormalViewRestoredProperties和相关成员,以提供对演示文稿的“常规视图属性”的访问。

普通视图由三个内容区域组成:幻灯片本身,侧面内容区域和底部内容区域。此信息允许应用程序将其视图状态保存到文件中,以便在重新打开时视图处于与上次保存演示文稿时相同的状态。添加了属性IViewProperties.NormalViewProperties以提供对演示文稿的普通视图属性的访问。添加了INormalViewPropertiesINormalViewRestoredProperties 接口及其后代 SplitterBarStateType枚举。

INormalViewProperties

  • 属性ShowOutlineIcons指定在正常视图模式的任何内容区域中显示大纲内容时应用程序是否应显示图标。
  • 属性SnapVerticalSplitter指定当侧面区域足够小时,垂直分割器是否应捕捉到最小化状态。
  • 属性PreferSingleView指定用户是否更喜欢在具有三个内容区域的标准普通视图上看到全窗口单内容区域。如果启用,则应用程序可以选择在整个窗口中显示一个内容区域。
  • 属性VerticalBarState和HorizontalBarState指定应显示水平或垂直分割条的状态。水平分割条将幻灯片与幻灯片下方的内容区域分开,垂直分割条将幻灯片与边内容区域分开。
  • 属性SnapVerticalSplitter指定当侧面区域足够小时,垂直分割器是否应捕捉到最小化状态。
  • 属性RestoredLeft和RestoredTop指定正常视图的顶部或侧面幻灯片区域的大小,当SplitterBarStateType.Restored值相应地应用于  VerticalBarState  和  HorizontalBarState*.*时

INormalViewRestoredProperties

  • 属性DimensionSize   指定幻灯片区域的大小(restoredTop的子节点的宽度,restoredLeft的子节点的高度)。
  • 属性AutoAdjust指定在调整应用程序中包含视图的窗口大小时,旁边内容区域的大小是否应该补偿新大小。
using (Presentation pres =  new  Presentation())
{
     pres.ViewProperties.NormalViewProperties.HorizontalBarState = SplitterBarStateType.Restored;
     pres.ViewProperties.NormalViewProperties.VerticalBarState = SplitterBarStateType.Maximized;
   
     pres.ViewProperties.NormalViewProperties.RestoredTop.AutoAdjust =  true ;
     pres.ViewProperties.NormalViewProperties.RestoredTop.DimensionSize =  80 ;
     pres.ViewProperties.NormalViewProperties.ShowOutlineIcons =  true ;
   
     pres.Save( "presentation.pptx" , SaveFormat.Pptx);
}

▲添加了新的IOleObjectFrame .SubstitutePictureTitle属性

新属性SubstitutePictureTitle添加到IOleObjectFrame接口和OleObjectFrame类中。它允许获取,设置或更改OLE图标的标题:

// Returns or set the title for OleObject icon.
/// Read/write.
/ When IsObjectIcon == false this value is ignored.
/// The string can be truncated according to the size of the Ole icon.
///string SubstitutePictureTitle { get; set; }

下面的代码片段显示了创建Excel对象并设置其标题的示例:

string oleSourceFile =  "ExcelObject.xlsx" ;
string oleIconFile =  "Image.png" ;
   
using (Presentation pres =  new  Presentation())
{
     IPPImage image =  null ;
     ISlide slide = pres.Slides[ 0 ];
   
     // Add Ole objects
     byte[] allbytes = File.ReadAllBytes(oleSourceFile);
     IOleObjectFrame oof = slide.Shapes.AddOleObjectFrame( 20 20 50 50 "Excel.Sheet.12" , allbytes);
     oof.IsObjectIcon =  true ;
   
     // Add image object
     byte[] imgBuf = File.ReadAllBytes(oleIconFile);
     using (MemoryStream ms =  new  MemoryStream(imgBuf))
     {
         image = pres.Images.AddImage( new  Bitmap(ms));
     }
     oof.SubstitutePictureFormat.Picture.Image = image;
   
     // Set caption to OLE icon
     oof.SubstitutePictureTitle =  "Caption example" ;
}

▲增加了对气泡大小值表示的支持

BubbleSizeRepresentation指定气泡图表中气泡大小值的表示方式。可能的值有:BubbleSizeRepresentationType.AreaBubbleSizeRepresentationType.Width。因此,添加了BubbleSizeRepresentationType枚举以指定将数据表示为气泡图大小的可能方式。

using (Presentation pres =  new  Presentation())
{
     IChart chart = pres.Slides[ 0 ].Shapes.AddChart(ChartType.Bubble,  50 50 600 400 true );
   
     chart.ChartData.SeriesGroups[ 0 ].BubbleSizeRepresentation = BubbleSizeRepresentationType.Width;
   
      pres.Save( "Presentation.pptx" , SaveFormat.Pptx);
}

▲添加了新的ISvgImage接口和SvgImage类

添加了新的ISvgImage接口来表示SVG图像:

// Represents an SVG image.
///[ComVisible(true), Guid("8BB43C22-78D1-4032-A149-82FCD3992F0F"), CsToCppPorter.CppVirtualInheritance("System.Object")]
public  interface  ISvgImage
{
        // Returns SVG content.
        /// Read-only.
        ///string SvgContent { get; }
   
        // Returns SVG data.
        /// Read-only.
        ///byte[] SvgData { get; }
   
        // Return callback interface used to resolve external resources during SVG documents import.
        /// Read-only.
        ///IExternalResourceResolver ExternalResourceResolver { get; }
   
        // Returns base URI of the specified SVG. Used to resolve relative links.
        /// Read-only.
        ///string BaseUri { get; }
}

▲AddImage方法已添加到IImageCollection接口和ImageCollection类中

IImageCollection接口和ImageCollection类中添加了新的AddImage方法:

// Add an image to a presentation from SVG object.
//Svg image object///Added image.///When svgImage parameter is null.IPPImage AddImage(ISvgImage svgImage);

这些方法提供了将Svg片段插入到演示文稿的图像集合的功能:

using ( var  p =  new  Presentation())
{
     string svgContent = File.ReadAllText(svgPath);
     ISvgImage svgImage =  new  SvgImage(svgContent);
     IPPImage ppImage = p.Images.AddImage(svgImage);
     p.Slides[ 0 ].Shapes.AddPictureFrame(ShapeType.Rectangle,  0 0 , ppImage.Width, ppImage.Height, ppImage);
     p.Save(outPptxPath, SaveFormat.Pptx);
}

using ( var  p =  new  Presentation())
{
     string svgContent = File.ReadAllText( new  Uri( new  Uri(baseDir),  "image1.svg" ).AbsolutePath);
     ISvgImage svgImage =  new  SvgImage(svgContent,  new  ExternalResourceResolver(), baseDir);
     IPPImage ppImage = p.Images.AddImage(svgImage);
     p.Slides[ 0 ].Shapes.AddPictureFrame(ShapeType.Rectangle,  0 0 , ppImage.Width, ppImage.Height, ppImage);
     p.Save(outPptxPath, SaveFormat.Pptx);
}

▲属性SvgImage属性添加到IPPImage接口和PPImage类

新属性SvgImage已经添加到IPPImage接口和PPImage类:

// Returns or sets ISvgImage object//This value indicates that this image has been created from svg.ISvgImage SvgImage { get; set; }

▲AddGroupShape方法添加到IShapeCollection接口和IShapeCollection类中

IShapeCollection接口和ShapeCollection类中添加了新的AddGroupShape方法:

// Creates a new GroupShape, fills it with converted shapes from SVG and adds it to the end of the collection.
//Svg image object///The X coordinate for the left side of the shape group frame.
///The Y coordinate for the top side of the shape group frame.///The width of the group of the shape group frame.
///The height of a group of the shape group frame.
///Created GroupShape object.
IGroupShape AddGroupShape(ISvgImage svgImage, float x, float y, float width, float height);

此方法允许将表示SVG数据的SvgImage对象转换为形状组:

using (Presentation pres =  new  Presentation(pptxFileName))
{
     PictureFrame pFrame = pres.Slides[ 0 ].Shapes[ 0 as  PictureFrame;
     ISvgImage svgImage = pFrame.PictureFormat.Picture.Image.SvgImage;
     if  (svgImage !=  null )
     {
         // Convert svg image into group of shapes
         IGroupShape groupShape = pres.Slides[ 0 ].Shapes.AddGroupShape(svgImage, pFrame.Frame.X, pFrame.Frame.Y,
             pFrame.Frame.Width, pFrame.Frame.Height);
         // remove source svg image from presentation
         pres.Slides[ 0 ].Shapes.Remove(pFrame);
     }
}


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

转载于:https://my.oschina.net/u/4087915/blog/3064344

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

  1. 文档管理服务器 office,文档管理控件WebOffice的产品架构原理——一张图就能解释...

    WebOffice是流行于国内市场的文档管理控件.20多年来,经华尔太科技研发团队不断迭代升级,WebOffice已更新至2019版本,最新版永久突破谷歌Chrome.火狐FireFox.EDGE等浏 ...

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

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

  3. Word文档处理控件TX Text Control .NET for WPF

    Text Control .NET for WPF是一款功能全面的Word文档处理控件,可进行所见所得的文档编辑,加载.保存.编辑DOC.DOCX.RTF等文件,利用该控件还可以构建强大的Word报表 ...

  4. 加载、编辑和保存Wod格式所见所得的Word文档处理控件TX Text Control ActiveX

    TX Text Control ActiveX 控件为软件开发人员提供了强大的所见所得的Word文档处理,可以加载.编辑和保存Wod格式(DOCX.DOC.RTF等),生成Word报表,文档转换,导出 ...

  5. Word文档管理首选工具Aspose.Words for .NET完整功能一览!

    Aspose.Words for .NET(点击下载)是用于执行各种文档管理和操作任务,支持生成,修改,转换,呈现和打印文档,而无需在跨平台应用程序中直接使用Microsoft Word.同时支持所有 ...

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

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

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

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

  8. 在线文档webOffice控件使用心得

    目前尚无免费的跨浏览器的office文档插件.而收费的有款PageOffice,但是在实际使用时,与直接开启office编辑工具相比,功能上还存在较大差异. 使用WebOffice weboffie可 ...

  9. 国产文档处理控件Spire.Doc WPS Word文档功能上线!快速创建Word指南

    Spire.Doc for Java 是一款专业的Java Word组件,开发人员使用它可以轻松地将Word文档创建.读取.编辑.转换和打印等功能集成到自己的Java应用程序中. 本文将介绍如何使用S ...

最新文章

  1. python 16进制转10进制, 8进制转10进制, 2进制转10进制的方法
  2. Pentaho平台上加仪表盘插件步骤
  3. C段渗透攻击必看的技术知识
  4. javascript里的面向对象
  5. ssl提高组周三备考赛【2018.10.31】
  6. android 魅族短信拦截,如何防护手机里的个人信息?魅族18系列教你如何防范隐私泄露...
  7. java代码 网站_推荐几个比较好的Java代码查询网站
  8. matlab pso 信号压缩重构_肇庆永磁变频空气压缩机研发,专业是我们品质服务
  9. C3P0与DBCP数据库连接池的区别,阿里的Druid数据源配置入门
  10. 使用apidoc 生成Restful web Api文档——新手问题与解决方法
  11. 使用wireshark对HTTPS解密
  12. linux mantis安装 yum,CentOS 安装和配置 Mantis
  13. Intellij IDEA与Eclipse对比
  14. mysql查询:分组查询
  15. IR的评价指标-MAP,NDCG和MRR
  16. Python pyspider的安装
  17. MQL5更换默认储存地址
  18. 解决windows xp 局域网共享
  19. 利用Python实现纬度加权平均(即NCL中的wgt_areaave)
  20. 基于java的springboot在线外卖点餐系统毕业设计springboot开题报告

热门文章

  1. python语言程序设计编程题_Python语言程序设计(2020年版)高等教育出版社,课后编程题答案(仅供参考)...
  2. 北京户口的十大流言和误会
  3. wps演示怎么提高列表级别_轻松制作多层等级划分
  4. Nginx的location的规则及斜线的重要性
  5. 【程序员应该知道的十八条法律与法规】法律学习
  6. 这个项目差点就烂尾了...
  7. java实战项目源码-模仿天猫商城网站
  8. 苏宁易购有哪些接口?
  9. 【精华贴】支付宝开放平台简介
  10. 浏览器,太坑的字体设置