Generate PowerPoint 2007/2010 file using Java

前端 未结 6 2070
南旧
南旧 2020-12-28 17:06

Does anyone know of any API (commercial or open-source) that can generate/edit PowerPoint 2007/2010 presentations through Java. I have a template in the PowerPoint 2007/201

6条回答
  •  清酒与你
    2020-12-28 17:59

    To generate a PowerPoint presentation from a template file, you can use PPT Templates.

    This library provides a fluent API to replace variables inside the PPT template:

    try(FileOutputStream out = new FileOutputStream("generated.pptx")) {
      new PptMapper()
        .text("variable", "Hello")
        .text("other_variable", "World!")
        .processTemplate(PptTemplateDemo.class.getResourceAsStream("/title.pptx"))
        .write(out);
    }
    

    With this library, you can process text and images in the template.

提交回复
热议问题