本文介绍如何使用spire.presentation for java将powerpoint文档转换为html文档。
import com.spire.presentation.fileformat;
import com.spire.presentation.presentation;
public class tohtml {
public static void main(string[] args) throws exception {
//创建presentation对象
presentation presentation = new presentation();
//加载示例文档
presentation.loadfromfile("c:\\users\\administrator\\desktop\\sample.pptx");
//保存为html格式文档
presentation.savetofile("c:\\users\\administrator\\desktop\\tohtml.html
", fileformat.html);
}
}
结果文档: