PowerPoint Generator API
  • PowerPoint Generator API
  • Getting started
    • Quick start
  • API reference
    • token/create
    • generator/create
  • Knowledge base
    • Key concepts
    • Templating your presentation
    • Building your JSON payload
    • Finding shape names
  • JSON/ PPTX Reference
    • presentation
    • slides
    • shapes
      • textbox
      • chart
      • picture
      • table
    • tags
    • Deprecated
  • Examples
    • Presentation
      • Naming output presentation
      • Using multiple templates
    • Slide
      • Change shape size and position
      • Change shape background color
      • Hide or remove shape
      • Replacing tags
    • Textboxes
      • Add text
      • Set font type and size
      • Set font color and font background color
      • Set bold, italic & underline
      • Set text alignment
      • Set text indentation
      • Set text line spacing
      • Using bullet-points
    • Chart
      • Change font settings
      • Insert data
      • Adjust chart legend
      • Appending to data labels
    • Pictures
    • Table
      • Populate simple table
      • Using `text_runs` in Table cells
      • Handling merged cells
      • Update a specific cells in existing table
    • Tags
Powered by GitBook
On this page

Was this helpful?

  1. Examples
  2. Textboxes

Set text alignment

PreviousSet bold, italic & underlineNextSet text indentation

Last updated 11 months ago

Was this helpful?

  1. Find the shape name you want to update. See 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": [
      {
        "slide_index": 0,
        "shapes": [
          {
            "name": "Title 1",
            "text": [
              {
                "text_run": "Text align: left\n",
                "text_properties": {
                  "text_align": "left"
                }
              },
              {
                "text_run": "Text align: center\n",
                "text_properties": {
                  "text_align": "center"
                }
              },
              {
                "text_run": "Text align: right\n",
                "text_properties": {
                  "text_align": "right"
                }
              },
              {
                "text_run": "Text align: justified\n",
                "text_properties": {
                  "text_align": "justified"
                }
              },
              {
                "text_run": "Text align: distribution\n",
                "text_properties": {
                  "text_align": "dist"
                }
              }
            ]
          }
        ]
      }
    ]
  }
}
here
38KB
slides_as_template_text_align.pptx