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 font color and font background color

PreviousSet font type and sizeNextSet bold, italic & underline

Last updated 1 year 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 color setting font_color or font backgrount stetting font_bg_color for selected text under text_properties.

  4. Insert either c (e.g. black), RGB (e.g. 0,0,0), or (e.g. #000000) as value for font_color and font_bg_color

  5. Insert new_line as boolean before another text_run.

Before and After

Template Presentation

JSON Payload

{
  "presentation": {
    "template": "slides_as_template_text_font_color.pptx",
    "export_version": "Pptx2010",
    "slides": [
      {
        "slide_index": 0,
        "shapes": [
          {
            "name": "Title 1",
            "text": [
              {
                "text_run": "Text color",
                "text_properties": {
                  "font_color": "147, 147, 132"
                }
              },
              {
                "text_run": "Text background color",
                "text_properties": {
                  "font_bg_color": "#f5f5dc"
                }
              }
            ]
          }
        ]
      }
    ]
  }
}
here
olor name
Hex
35KB
slides_as_template_text_font_color.pptx