用于将 XSLFO 导出为 PPSM 的 Java API

通过本地 Java API 将 XSLFO 导出到 PPSM,无需使用 Microsoft® PowerPoint 或 Adobe® Acrobat Reader

 

使用 Aspose.Total for Java ,您可以在任何 Java J2SE、J2EE、J2ME 应用程序中轻松地将 XSLFO 转换为 PPSM。首先,通过使用 Aspose.PDF for Java ,您可以将 XSLFO 导出为 PPTX。之后,通过使用 Aspose.Slides for Java PowerPoint Processing API,您可以将 PPTX 转换为 PPSM。

Java API 将 XSLFO 转换为 PPSM

  1. Document 类打开XSLFO文件
  2. 使用 save 方法将 XSLFO 转换为 PPTX
  3. Presentation 类加载PPTX文档
  4. 使用 save 方法将文档保存为 PPSM 格式并设置 Ppsm 作为 SaveFormat

转换要求

从您可以直接从基于 Maven 的项目轻松地使用 Aspose.Total for Java 并在您的 pom.xml 中包含库。

或者,您可以从 下载 获取 ZIP 文件。

// load XSLFO file with an instance of Document class
Document document = new Document("template.xslfo");
// save XSLFO as PPTX format 
document.save("PptxOutput.pptx", SaveFormat.Pptx); 
// instantiate a Presentation object that represents a PPTX file
Presentation presentation = new Presentation("PptxOutput.pptx");
// save the presentation as Ppsm format
presentation.save("output.ppsm", SaveFormat.Ppsm);   

通过 Java 打开加密的 XSLFO 文件

加载 XSLFO 文件格式时,您的文档可能受密码保护。 Aspose.PDF for Java 也允许您打开加密文档。为了打开加密文件,您可以初始化[Document]的新实例( https://reference.aspose.com/pdf/java/com.aspose.pdf/Document#Document-java.lang.String-java.lang.String- ) 类并将文件名和密码作为参数传递。

// open XSLFO document
Document doc = new Document("input.xslfo", "Your@Password");
// save XSLFO as PPTX format 
document.save("PptxOutput.pptx", SaveFormat.Pptx); 

通过 Java 保存具有预定义视图类型的 PPSM 文件

将 XSLFO 转换为 PPSM 后,您还可以为演示文稿添加预定义的视图类型。 Aspose.Slides for Java 提供了一种工具来设置生成的演示文稿在通过 [ViewProperties](https:// /apireference.aspose.com/slides/java/com.aspose.slides/ViewProperties) 类。 setLastView 属性用于通过使用[ViewType](https:// /apireference.aspose.com/slides/java/com.aspose.slides/ViewType) 枚举器。

// instantiate a Presentation object that represents a PPTX file
Presentation presentation = new Presentation("PptxOutput.pptx");
// set view type
presentation.getViewProperties().setLastView((byte) ViewType.SlideMasterView);
// save the presentation as Ppsm format
presentation.save("output.ppsm", SaveFormat.Ppsm);    

使用Java 探索XSLFO转换选项

将XSLFO转换为CSV (逗号分隔值)
将XSLFO转换为DIF (数据交换格式)
将XSLFO转换为EXCEL (电子表格文件格式)
将XSLFO转换为FODS (OpenDocument 平面 XML 电子表格)
将XSLFO转换为MD (降价语言)
将XSLFO转换为ODS (OpenDocument电子表格)
将XSLFO转换为SXC (StarSuite Calc 电子表格)
将XSLFO转换为TSV (制表符分隔值)
将XSLFO转换为TXT (文本文件)
将XSLFO转换为XLAM (Excel 启用宏的加载项)
将XSLFO转换为XLSB (Excel 二进制工作簿)
将XSLFO转换为XLSM (启用宏的电子表格)
将XSLFO转换为XLT (Excel 97 - 2003 模板)
将XSLFO转换为XLTM (Excel 启用宏的模板)
将XSLFO转换为XLTX (Excel模板)
将XSLFO转换为ODP (OpenDocument 演示文稿格式)
将XSLFO转换为OTP (OpenDocument 标准格式)
将XSLFO转换为POT (Microsoft PowerPoint 模板文件)
将XSLFO转换为POTM (Microsoft PowerPoint 模板文件)
将XSLFO转换为POTX (Microsoft PowerPoint 模板演示)
将XSLFO转换为PPT (PowerPoint演示文稿)
将XSLFO转换为PPS (PowerPoint 幻灯片放映)
将XSLFO转换为PPSX (PowerPoint 幻灯片放映)
将XSLFO转换为PPT (PowerPoint演示文稿)
将XSLFO转换为PPTM (启用宏的演示文稿文件)
将XSLFO转换为SWF (冲击波动画)
将XSLFO转换为APNG (动画便携式网络图形)
将XSLFO转换为DICOM (医学数字成像和通信)
将XSLFO转换为DXF (Autodesk 图形交换格式)
将XSLFO转换为EMZ (Windows 压缩增强图元文件)
将XSLFO转换为IMAGE (图像文件)
将XSLFO转换为JPEG2000 (J2K图像格式)
将XSLFO转换为PSD (Photoshop文档)
将XSLFO转换为SVGZ (压缩的可缩放矢量图形)
将XSLFO转换为TGA (Truevision 图形适配器)
将XSLFO转换为WMF (Windows 图元文件)
将XSLFO转换为WMZ (压缩的 Windows 图元文件)