原創|產品更新|編輯:李顯亮|2020-05-08 10:29:49.350|閱讀 245 次
概述:Aspose.Slides For .Net更新至v20.5,支持數學方程式(OMML),新增識別受讀和寫保護的演示文稿功能和添加驗證密碼,并有1個功能正在調研中,歡迎下載體驗。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Aspose.Slides for .NET是一個獨特的演示處理API,它允許應用程序讀取、寫入、修改和轉換PowerPoint演示文稿。作為一個獨立的API,它提供了管理PowerPoint關鍵功能的功能,如管理文本、形狀、表格和動畫、向幻燈片添加音頻和視頻、預覽幻燈片等,而不需要Microsoft PowerPoint。
Aspose.Slides for .NET迎來2020年5月更新v20.5,支持數學方程式(OMML),新增識別受讀和寫保護的演示文稿功能和添加驗證密碼,并有1個功能正在調研中。(點擊下方按鈕即可下載)
key | 概述 | 類別 |
---|---|---|
SLIDESNET-41835 | 與Aspose.Slides相關的性能問題 | 調查中 |
SLIDESNET-41786 | 添加驗證密碼的功能以進行修改 | 功能 |
SLIDESNET-40011 | 一行對齊多個形狀 | 功能 |
SLIDESNET-38923 | 識別受讀和寫保護的演示文稿的功能 | 功能 |
SLIDESNET-37280 | 支持數學方程式(OMML) | 功能 |
SLIDESNET-41621 | 導入Excel EMF圖像的寬高比已損壞 | 增強功能 |
SLIDESNET-38545 | 在將長文本添加到單元格后,獲取實際的表行高度 | 增強功能 |
這項新功能有助于更改幻燈片上選定形狀的位置。將形狀與幻燈片的邊距或邊緣對齊,或使它們彼此相對對齊。
為了支持上圖中的PowerPoint選項,添加了新的重載 SlideUtil.AlignShapes方法和ShapeAlignmentType 枚舉。
ShapeAlignmentType枚舉
所述ShapeAlignmentType 確定的方式來對準的形狀。ShapeAlignmentType 枚舉的可能值:AlignLeft、AlignRight、AlignCenter、AlignTop、AlignMiddle、AlignBottom、DistributeHorizontally、DistributeVertically。
SlideUtil.AlignShape()方法
該方法更改幻燈片上選定形狀的位置。輸入參數:
用例1
假設我們要沿著幻燈片的頂部邊框將形狀與索引1、2和4對齊。以下是如何實現此目標的代碼段。
using (Presentation pres = new Presentation("example.pptx")) { ISlide slide = pres.Slides[0]; IShape shape1 = slide.Shapes[1]; IShape shape2 = slide.Shapes[2]; IShape shape3 = slide.Shapes[4]; SlideUtil.AlignShapes(ShapesAlignmentType.AlignTop, true, pres.Slides[0], new int[] { slide.Shapes.IndexOf(shape1), slide.Shapes.IndexOf(shape2), slide.Shapes.IndexOf(shape3) }); }
用例2
另一個選項顯示如何在幻燈片上對齊整個形狀集合:
using (Presentation pres = new Presentation("example.pptx")) { SlideUtil.AlignShapes(ShapesAlignmentType.AlignBottom, false, pres.Slides[0].Shapes); }
IsWriteProtected 屬性和 CheckWriteProtection 方法已添加到 IPresentationInfo 接口和 PresentationInfo 類。此屬性和方法允許檢查演示文稿是否受密碼保護以進行修改。修改密碼的目的是在演示文稿上設置寫保護。寫保護限制了使用主機應用程序將演示文稿保存到同一路徑的能力。
屬性和方法聲明:
///用例
下面的示例演示如何檢查密碼以修改演示文稿:
IPresentationInfo info = PresentationFactory.Instance.GetPresentationInfo(presentationFilePath); bool isWriteProtectedByPassword = info.IsWriteProtected == NullableBool.True && info.CheckWriteProtection(“ my_password”);
CheckWriteProtection 方法已添加到 IProtectionManager 接口和 ProtectionManager 類。此方法允許檢查演示文稿是否受密碼保護以進行修改。修改密碼的目的是在演示文稿上設置寫保護。寫保護限制了使用主機應用程序將演示文稿保存到同一路徑的能力。
方法聲明:
///用例
下面的示例演示如何檢查密碼以修改演示文稿:
using (var presentation = new Presentation(presentationFilePath)) { bool isWriteProtected = presentation.ProtectionManager.CheckWriteProtection("my_password"); }
IsPasswordProtected 屬性已添加到 IPresentationInfo接口和 PresentationInfo 類。此屬性允許檢查演示文稿是否受保護可以打開。為文檔設置密碼后,演示文稿可以打開。
方法聲明:
///用例
下面的示例演示如何檢查保護是否打開:
IPresentationInfo info = PresentationFactory.Instance.GetPresentationInfo(presentationFilePath); if (info.IsPasswordProtected) { Console.WriteLine("The presentation '" + presentationFilePath + "' is protected by password to open."); }
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn