翻譯|使用教程|編輯:李顯亮|2021-08-04 10:30:48.360|閱讀 277 次
概述:在某些情況下,可能需要將 PowerPoint 演示文稿轉換為 Word 文檔。為了自動化此過程或批量轉換,本文介紹了如何使用 C# 將 PowerPoint PPTX/PPT 轉換為 Word DOCX。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
在某些情況下,可能需要將 PowerPoint 演示文稿轉換為 Word 文檔。為了自動化此過程或批量轉換,本文介紹了如何使用 C# 將 PowerPoint PPTX/PPT 轉換為 Word DOCX。
為了將 PowerPoint 演示文稿轉換為 Word 文檔,我們將結合使用Aspose.Slides for Java和Aspose.Words for .NET,前者是一種演示操作 API,可讓您創建或修改 PowerPoint 演示。而后者是用于生成或處理 Word 文檔的文字處理 API。
>>你可以點擊這里下載Aspose.Slides 最新版測試體驗。
以下是使用 C# 將 PowerPoint 演示文稿轉換為 Word 文檔的步驟。
以下代碼示例展示了如何使用 C# 將 PPTX 轉換為 DOCX。
// Load the PowerPoint presentation using(Aspose.Slides.Presentation presentation = new Aspose.Slides.Presentation("pres.pptx")) { using (var stream = new MemoryStream()) { // Save presentation to memory stream presentation.Save(stream, SaveFormat.Html); stream.Flush(); stream.Seek(0, SeekOrigin.Begin); // Load the content of the presentation to a Word document var doc = new Aspose.Words.Document(stream); // Save the Word document doc.Save("pres.docx", Aspose.Words.SaveFormat.Docx); } }
如果你想試用Aspose的全部完整功能,可聯系在線客服獲取30天臨時授權體驗。
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn