Use a Document Template

Introduction

The following method allows you to create a PowerPoint presentation from a template and data using template engine. Using templates, you can create presentations with the same look but different content depending on the data being transferred.

API Information

API Type Description Resource
/slides/{name}/fromTemplate POST Creates a new presentation from a template in a storage. CreatePresentationFromTemplate

Request Parameters

Name Type Location Required Description
name string path true The file name for the new presentation.
templatePath string query true The path to a template file.
data string body false The input data for filling the presentation template.
templatePassword string header false The password to open the template file.
templateStorage string query false The storage name where the template file is located.
isImageDataEmbeeded boolean query false Indicates whether the input data contains embedded images in Base64 format.
password string header false The password to encrypt the new presentation.
folder string query false The folder path where the new presentation will be located.
storage string query false The storage name where the new presentation will be located.

cURL Examples

Create a new presentation Data/JohnDoeCV.pptx in a Main storage from a template Resources/TemplateCV.pptx and data for the template.

Data for the template
<?xml version="1.0" encoding="UTF-8"?>
<staff>
   <person>
      <name>John Doe</name>
      <address>
         <line1>10 Downing Street</line1>
         <line2>London</line2>
      </address>
      <phone>+457 123456</phone>
      <bio>Hi, I'm John and this is my CV</bio>
      <skills>
         <skill>
            <title>C#</title>
            <level>Excellent</level>
         </skill>
         <skill>
            <title>Cpp</title>
            <level>Good</level>
         </skill>
         <skill>
            <title>Java</title>
            <level>Average</level>
         </skill>
      </skills>
   </person>
</staff>

SDK Examples

Create a new presentation Data/JohnDoeCV.pptx in a Main storage from a template Resources/TemplateCV.pptx and data for the template.

Data for the template
<?xml version="1.0" encoding="UTF-8"?>
<staff>
   <person>
      <name>John Doe</name>
      <address>
         <line1>10 Downing Street</line1>
         <line2>London</line2>
      </address>
      <phone>+457 123456</phone>
      <bio>Hi, I'm John and this is my CV</bio>
      <skills>
         <skill>
            <title>C#</title>
            <level>Excellent</level>
         </skill>
         <skill>
            <title>Cpp</title>
            <level>Good</level>
         </skill>
         <skill>
            <title>Java</title>
            <level>Average</level>
         </skill>
      </skills>
   </person>
</staff>

SDKs

Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of making requests and handling responses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of Aspose.Slides Cloud SDKs along with working examples, to get you started in no time. Please check Available SDKs article to learn how to add an SDK to your project.