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
▲添加了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)已開通,各種資源及時分享,歡迎交流討論!