Set text alignment

  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_align.pptx",
    "export_version": "Pptx2010",
    "slides": [
      {
        "type": "slide",
        "slide_index": 0,
        "shapes": [
          {
            "name": "Title 1",
            "text_content": [
              {
                "text_run": "Text align: left",
                "text_properties": {
                  "text_align": "left",
                  "new_line": true
                }
              },
              {
                "text_run": "Text align: center",
                "text_properties": {
                  "text_align": "center",
                  "new_line": true
                }
              },
              {
                "text_run": "Text align: right",
                "text_properties": {
                  "text_align": "right",
                  "new_line": true
                }
              },
              {
                "text_run": "Text align: justified",
                "text_properties": {
                  "text_align": "justified",
                  "new_line": true
                }
              },
              {
                "text_run": "Text align: distribution",
                "text_properties": {
                  "text_align": "dist",
                  "new_line": true
                }
              }
            ]
          }
        ]
      }
    ]
  }
}

Last updated