簡單工具學會快速在java中將 PowerPoint 文檔轉換爲 HTML 格式文件

Spire.Presentation for Java 專業的 PowerPoint API,它允許開發人員在 Java 應用程序中創建、讀取、寫入、轉換和保存 PowerPoint 文檔,而無需安裝 Microsoft PowerPoint。

本文向您展示如何使用 Spire.Presentation for Java 將 PowerPoint 文檔轉換爲 HTML 格式文件。可下載最新版測試。


下面是示例PowerPoint文檔的屏幕截圖。

國產PPT格式控件Spire.Presentation功能演示:在 Java 中將 PowerPoint 轉換爲 HTML
import com.spire.presentation.FileFormat;
import com.spire.presentation.Presentation;

public class ToHtml {
    public static void main(String[] args) throws Exception {

        //Create a Presentation object 
        Presentation presentation = new Presentation();

        //Load the sample document 
        presentation.loadFromFile("C:\\Users\\Administrator\\Desktop\\sample.pptx");

        //Save the document to HTML format 
        presentation.saveToFile("C:\\Users\\Administrator\\Desktop\\ToHtml.html", FileFormat.HTML);
    }
}

輸出文件

國產PPT格式控件Spire.Presentation功能演示:在 Java 中將 PowerPoint 轉換爲 HTML

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章