Set text line spacing

  1. Find the shape name you want to update. See here to find shape names.

  2. Specify the text need amending under text_run. Text within one textbox can be split into multiple chunks.

  3. Add font settings for selected text under text_properties.

  4. Insert new_line as boolean before another text_run.

Before and After

Template Presentation

JSON Payload

{
  "presentation": {
    "template": "slides_as_template_text_line_spacing.pptx",
    "export_version": "Pptx2010",
    "slides": [
      {
        "type": "slide",
        "slide_index": 0,
        "shapes": [
          {
            "name": "Title 2",
            "content": "Text indent",
            "settings": {
              "text_line_spacing": 3
            }
          }
        ]
      }
    ]
  }
}

The code got error message 1 slide not found in the template file!, Slide Index:0

{
   "presentation":{
      "template":"slides_as_template_text_line_spacing.pptx",
      "export_version":"Pptx2010",
      "slides":[
         {
            "type":"slide",
            "slide_index":1,
            "shapes":[
               {
                  "name":"Title 2",
                  "text_content":[
                     {
                        "text_run":"Text line spacing",
                        "text_properties":{
                           "text_line_spacing": 3,
"new_line":true
                                                }
                     }
                  ]
               }
            ]
         }
      ]
   }
}

Last updated