
註解是創建簡報時的重要組成部分。您添加演講者註解以便在向觀眾展示幻燈片時稍後參考。在演示期間,演講者註解會在您的顯示器上顯示,但觀眾看不見。因此,註解窗格是儲存您在進行演示時想要提及的講話要點的地方。
Aspose.Slides Cloud 提供了向 PowerPoint 幻燈片中添加、更新或刪除註釋的功能。您可以對本地系統驅動器上可用的 PowerPoint 幻燈片或存儲在雲端存儲中的幻燈片執行此操作。
在幻燈片上添加註釋
為了添加備註,您需要嘗試使用 NotesSlide/PostAddNotesSlide。以下 cURL 命令使您可以將備註添加到 PowerPoint 幻燈片中。
curl -X POST "https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/1/notesSlide" -H "accept: application/json" -H "authorization: Bearer <jwt token>" -H "Content-Type: application/json" -d "{ \"Text\": \"These are sample presenter notes added using Aspose.Slides Cloud\",}"
請求 URL
https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/1/notesSlide
回應主體
{<strong>
</strong>"text":** **"These are sample presenter notes added using Aspose.Slides Cloud",<strong>
</strong>"shapes":** **{<strong>
</strong>"uri":** **{<strong>
</strong>"href":** **"https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/1/notesSlide/shapes",<strong>
</strong>"relation":** **"self"<strong>
</strong>}<strong>
</strong>},<strong>
</strong>"selfUri":** **{<strong>
</strong>"href":** **"https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/1/notesSlide",<strong>
</strong>"relation":** **"self"<strong>
</strong>}<strong>
</strong>}
C#.NET code snippet
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
// 初始化 Aspose.Slides Cloud 物件
SlidesApi slidesApi = new SlidesApi(MyAppSid, MyAppKey);
String fileName = "NotesPresentation.pptx";
// NotesSlide dto 物件用來表示幻燈片註解
NotesSlide notesSlide = new NotesSlide();
// sample text for the Notes area
notesSlide.Text = "These are sample presenter notes added using Aspose.Slides Cloud";
// 建立 PostAddNotesSlideRequest 物件以將註解新增至 PPTX 檔案
PostAddNotesSlideRequest postAddNotesSlideRequest = new PostAddNotesSlideRequest();
// 要添加註解的檔案名稱
postAddNotesSlideRequest.Name = fileName;
// 在 PowerPoint 演示文稿中的幻燈片索引
postAddNotesSlideRequest.SlideIndex = 1;
// NotesSlide object
postAddNotesSlideRequest.Dto = notesSlide;
// 將 NotesSlideRequest 添加至 SlidesApi 實例
slidesApi.PostAddNotesSlide(postAddNotesSlideRequest);

Image 1:- 沒有註解的 PowerPoint 投影片

Image 2:- 包含附加註解的PowerPoint投影片
更新幻燈片註解
您也可以使用 API 來更新 PowerPoint 簡報中的筆記。為了滿足這一要求,使用 NotesSlide/PutUpdateNotesSlide。
cURL 命令
curl -X PUT "https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/1/notesSlide" -H "accept: application/json" -H "authorization: Bearer <jwt token>" -H "Content-Type: application/json" -d "{ \"Text\": \"Notes updated using Aspose.Slides Cloud API\", \"Shapes\": { \"Uri\": { \"Href\": \"https://products.aspose.cloud/slides/curl\", \"Title\": \"Aspose.Slides Cloud for cURL\" } }}"
請求 URL
https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/1/notesSlide
回應主體
{<strong>
</strong>"text":** **"Notes updated using Aspose.Slides Cloud API",<strong>
</strong>"shapes":** **{<strong>
</strong>"uri":** **{<strong>
</strong>"href":** **"https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/1/notesSlide/shapes",<strong>
</strong>"relation":** **"self"<strong>
</strong>}<strong>
</strong>},<strong>
</strong>"selfUri":** **{<strong>
</strong>"href":** **"https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/1/notesSlide",<strong>
</strong>"relation":** **"self"<strong>
</strong>}<strong>
</strong>}
C#.NET 代碼片段
string MyAppKey = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
string MyAppSid = "xxxxxxxx"; // Get AppKey and AppSID from https://dashboard.aspose.cloud/
// 初始化 Aspose.Slides Cloud 物件
SlidesApi slidesApi = new SlidesApi(MyAppSid, MyAppKey);
String fileName = "NotesPresentation.pptx";
// NotesSlide dto 物件以表示幻燈片註解
NotesSlide notesSlide = new NotesSlide();
// sample text for the Notes area
notesSlide.Text = "Notes updated using Aspose.Slides Cloud API";
// 創建 PutUpdateNotesSlideRequest 對象以更新 PPTX 文件中的註解
PutUpdateNotesSlideRequest putUpdateNotesSlideRequest = new PutUpdateNotesSlideRequest();
// 需要更新註解的檔案名稱
putUpdateNotesSlideRequest.Name = fileName;
// PowerPoint 簡報中的幻燈片索引
putUpdateNotesSlideRequest.SlideIndex = 1;
// NotesSlide 物件
putUpdateNotesSlideRequest.Dto = notesSlide;
// 將 PutUpdateNotesSlideRequest 添加到 SlidesApi 實例中
slidesApi.PutUpdateNotesSlide(putUpdateNotesSlideRequest);

Image 3:- 具有更新註解的幻燈片
閱讀幻燈片備註
PowerPoint 處理雲端 API 也提供讀取現有幻燈片備註的功能。您只需提供 PowerPoint 檔案名稱和要讀取備註詳情的幻燈片索引。GetNotesSlide 能夠幫助您滿足此要求。
cURL 命令
curl -X GET "https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/2/notesSlide" -H "accept: application/json" -H "authorization: Bearer <jwt token>"
回應主體
回應主體顯示從特定的 PowerPoint 簡報幻燈片中解析的幻燈片說明。
{<strong>
</strong>"text":** **"This is second slide of PowerPoint presentation",<strong>
</strong>"shapes":** **{<strong>
</strong>"uri":** **{<strong>
</strong>"href":** **"https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/2/notesSlide/shapes",<strong>
</strong>"relation":** **"self"<strong>
</strong>}<strong>
</strong>},<strong>
</strong>"selfUri":** **{<strong>
</strong>"href":** **"https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/2/notesSlide",<strong>
</strong>"relation":** **"self"<strong>
</strong>}<strong>
</strong>}
如果您需要查看請求主體中提供的文檔的備註幻燈片信息,請嘗試使用 PostGetNotesSlide。
刪除幻燈片註解
API 提供 DeleteNotesSlide 方法來移除/刪除 PowerPoint 幻燈片中的註解。
cURL 命令
curl -X DELETE "https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/1/notesSlide" -H "accept: application/json" -H "authorization: Bearer <jwt token>"

Image 4:- PowerPoint 幻燈片,已刪除註解
將註解幻燈片轉換為特定的圖像格式
您可能會遇到將包含註解的 PowerPoint 幻燈片渲染為特定影像格式的需求。為了滿足此需求,您需要使用 API 的 GetNotesSlideWithFormat 方法。
cURL 命令
curl -X GET "https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/2/notesSlide/Jpeg" -H "accept: multipart/form-data" -H "authorization: Bearer "
請求 URL
https://api.aspose.cloud/v3.0/slides/NotesPresentation.pptx/slides/2/notesSlide/Jpeg
因此,響應正文包含如下所示的轉換後的圖像。

Image 5:- 預覽第二張幻燈片包含備註

Image 6:- PowerPoint 註解幻燈片轉換為 JPEG 圖像格式