使用 Aspose.Total for Java ,您可以在任何 Java J2SE、J2EE、J2ME 应用程序中轻松地将 MD 转换为 POTX。首先,通过使用 Aspose.PDF for Java ,您可以将 MD 导出为 PPTX。之后,通过使用 Aspose.Slides for Java PowerPoint Processing API,您可以将 PPTX 转换为 POTX。
通过 Java 打开加密的 MD 文件
加载 MD 文件格式时,您的文档可能受密码保护。 Aspose.PDF for Java 也允许您打开加密文档。为了打开加密文件,您可以初始化[Document]的新实例( https://reference.aspose.com/pdf/java/com.aspose.pdf/Document#Document-java.lang.String-java.lang.String- ) 类并将文件名和密码作为参数传递。
// open MD document
Document doc = new Document("input.md", "Your@Password");
// save MD as PPTX format
document.save("PptxOutput.pptx", SaveFormat.Pptx);
通过 Java 保存具有预定义视图类型的 POTX 文件
将 MD 转换为 POTX 后,您还可以为演示文稿添加预定义的视图类型。 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 Potx format
presentation.save("output.potx", SaveFormat.Potx);
关键用例
从MD大纲创建干净且品牌化的POTX模板。
在多个部门之间标准化公司幻灯片。
从Markdown简报中构建营销幻灯片。
通过MD内容设计学术演示文稿模板。
自动化场景
在文档流程中自动化生成POTX。
使用Markdown作为源内容重新生成模板。
批量分发POTX文件给企业团队。
在品牌工作流程中定期进行MD到POTX的更新。