本文将介绍如何使用Spire.Presentation for Java将PowerPoint文件另存为XPS。
原PowerPoint文档:
import com.spire.presentation.*;
public class PPTtoXPS {
public static void main(String[] args) throws Exception{
//创建presentation对象
Presentation ppt = new Presentation();
//加载示例文档
ppt.loadFromFile("Sample.pptx");
//保存为XPS
ppt.saveToFile("toXPS.xps", FileFormat.XPS);
ppt.dispose();
}
}
效果图: