JSON API - customizeElementStyles

customizeElementStyles

PREMIUM TRIAL / ADVANCED

Changes elements styles on the fly in the PowerPoint presentation.

Note

You are reading the JSON API documentation. For the PHP API method please go to customizeElementStyles.

JSON data
Key Description
target
  • slide (default value)
  • slideLayout
  • theme
type
  • audio
  • chart
  • diagram
  • image
  • paragraph
  • run
  • section
  • shape (text box) (default value)
  • slide
  • table
  • table-row
  • table-cell
  • table-cell-paragraph
  • video
contains Contains a text string. For paragraph, run, shape, table, table-row, table-cell, table-cell-paragraph types.
occurrence
  • (number) exact occurrence from 1
  • (array) occurrences
  • (string) range of contents (e.g.: "2..9", "2..", "..9"), "first()", "last()"
attributes Contains a specific attribute key and value. Node or descendant attributes.
parent Immediate children (default as '/', any parent) or any other parent (a:tbl/, p:sp/...).
rootParent Root parent. Default as p:spTree for slide elements and p:presentation for presentation elements.
customQuery Custom XPath query, overwrites any other reference.
Key Description
coordinateX EMUs (English Metric Unit)
coordinateY EMUs (English Metric Unit)
name internal name
sizeX EMUs (English Metric Unit)
sizeY EMUs (English Metric Unit)

chart elements

Key Description
coordinateX EMUs (English Metric Unit)
coordinateY EMUs (English Metric Unit)
name internal name
sizeX EMUs (English Metric Unit)
sizeY EMUs (English Metric Unit)

diagram elements

Key Description
coordinateX EMUs (English Metric Unit)
coordinateY EMUs (English Metric Unit)
name internal name
sizeX EMUs (English Metric Unit)
sizeY EMUs (English Metric Unit)

image elements

Key Description
coordinateX EMUs (English Metric Unit)
coordinateY EMUs (English Metric Unit)
name internal name
sizeX EMUs (English Metric Unit)
sizeY EMUs (English Metric Unit)

paragraph elements

Key Description
align
  • left
  • center
  • right
  • justify
  • distributed
bold
characterSpacing
color HEX color
font Arial, Times New Roman ...
fontSize 8, 9, 10, 11 ...
highlight HEX color
indentation EMUs (English Metric Unit)
italic
lang
lineSpacing 1, 1.5, 2...
marginLeft EMUs (English Metric Unit)
(0 >= and <= 51206400)
marginRight EMUs (English Metric Unit)
(0 >= and <= 51206400)
rtl
spacingAfter points (0 >= and <= 158400)
spacingBefore points (0 >= and <= 158400)
strikethrough
underline single

run elements

Key Description
bold
characterSpacing
color HEX color
font Arial, Times New Roman ...
fontSize 8, 9, 10, 11 ...
highlight HEX color
italic
lang
strikethrough
underline single

shape elements

Key Description
coordinateX EMUs (English Metric Unit)
coordinateY EMUs (English Metric Unit)
fillColor HEX color
name internal name
sizeX EMUs (English Metric Unit)
sizeY EMUs (English Metric Unit)

table elements

Key Description
backgroundColor HEX color
columnWidths column width fix (number) or column width variable (array). EMUs (English Metric Unit)
coordinateX EMUs (English Metric Unit)
coordinateY EMUs (English Metric Unit)
name internal name
sizeX EMUs (English Metric Unit)
sizeY EMUs (English Metric Unit)

table-row elements

Key Description
backgroundColor HEX color
height EMUs (English Metric Unit)

table-cell elements

Key Description
backgroundColor HEX color
textDirection
  • horz
  • vert
  • vert270
  • wordArtVert
  • eaVert
  • mongolianVert
  • wordArtVertRtl
verticalAlign
  • top
  • middle
  • bottom
  • topCentered
  • middleCentered
  • bottomCentered

table-cell-paragraph elements

Key Description
align
  • left
  • center
  • right
  • justify
  • distributed
bold
characterSpacing
color HEX color
font Arial, Times New Roman ...
fontSize 8, 9, 10, 11 ...
highlight HEX color
indentation EMUs (English Metric Unit)
italic
lang
lineSpacing 1, 1.5, 2...
marginLeft EMUs (English Metric Unit)
rtl
spacingAfter points (0 >= and <= 158400)
spacingBefore points (0 >= and <= 158400)
strikethrough
underline single

theme elements

Key Description
color
  • accent1
  • accent2
  • accent3
  • accent4
  • accent5
  • accent6
  • dk1
  • dk2
  • folHlink
  • hlink
  • lt1
  • lt2

video elements

Key Description
coordinateX EMUs (English Metric Unit)
coordinateY EMUs (English Metric Unit)
name internal name
sizeX EMUs (English Metric Unit)
sizeY EMUs (English Metric Unit)

other options

Key Description
customAttributes Custom attributes and values.
Code samples

Example #1

A template can be a local file, a Base64 string, or a remote file.

Release notes
  • phppptx 5.0:
    • new action.