Skip to main content

Mapping Text

PowerPoint shapes with mass text like BODY, TITLE, SUBTITLE, etc. can be filled by XML content. Mass text is text with one or more paragraphs.

Text with multiple paragraphs​

There are several ways to specify this in the XML.

  • Newline characters:
    If the input from the XML contains newline characters (CR+LF or LF) these newline characters will be interpreted as paragraph separators and thus introduce new paragraphs.
  • Several value child elements
    Each value will be rendered in a new paragraph.

New line character in XML should be written as entity (
 or &#xA).

See the examples below.

Using the content attribute​

<!-- a simple single paragraph text -->
<placeholder name="my-body" content="Hello World"/>
<!-- two paragraphs -->
<placeholder name="my-body" content="Hello&amp;#10;World"/>
<!-- two columns separated by tabulator
Tab characters in the XML will produce the same effect as if added to PowerPoint via
Copy+Paste. It will depend on the tab ruler settings in the paragraph of the placeholder
shape.
-->
<placeholder name="my-body" content="Hello&amp;#9;World"/>

The content attribute is always plain text and does not support HTML markup.

Using value elements​

The value element is an alternative that can be used to specify text content.

  • It allows specifying a series of paragraphs.
  • It allows inserting rich text based on HTML markup
  • It allows adding non-textual data (forthcoming)

The content attribute takes precedence over the value elements. If the content attribute exists, then the values are ignored.

Producing Multiple Paragraphs

<!-- two paragraphs from a single value element -->
<placeholder name="my-body" >
<value>Hello&amp;#10;World</value>
</placeholder>
<!-- two paragraphs from two value elements -->
<placeholder name="my-body" >
<value>Hello</value>
<value>World</value>
</placeholder>
<!-- three paragraphs from two value elements -->
<placeholder name="my-body" >
<value>Brave&amp;#10;New</value>
<value>World</value>
</placeholder>

HTML Content​

Text placeholders can accept HTML content. HTML content does not work with the content attribute, the <value/> element is required for this.

Example:

<placeholder name="description">
<value type="html"><![CDATA[
<b>Bold</b><br/>
<i>Italic</i>
]]></value>
</placeholder>

The renderer converts supported HTML into rich PowerPoint formatting.

Note that HTML support may differ between normal text boxes and table cells.

Supported tags

  • <b/> (bold)
  • <i/> (italic)
  • <u/> (underline)
  • <s/> (strikethrough)
  • <sub/> (subscript)
  • <sup/> (superscript)
  • <font/> (legacy HTML4 style, see below)
  • <br/> (produces a new line break)
  • <p/> (produces a new line break)
  • <li/> (produces a new line break)

All other tags are NOT supported. style or class attributes are also NOT supported.

The legacy <font/> tag supports the following attributes

  • face (font name like Arial; fonts must exist on the target system that will open/edit the rendererd pptx; this cannot be checked during rendering in priint cloud)
  • size (font size in pt)
  • color (in hex format like #FF0000)
  • caps (enum all or small: UPPERCASE versus SMALLCAPS)