createListStyle

createListStyle

BASIC / ADVANCED / PREMIUM

Creates a custom list style to use it in combination with the addList and embedHTML methods.

Description
public createListStyle ( string $name [ array $options] )

This method allows to generate custom list styles that can be used in combination with the addList and embedHTML methods.

If you want that the embedded HTML code uses the generated list style this has to have the same name as the corresponding CSS class for the UL tag. Do not forget to set the option 'customListStyles' to true in your call to embedHTML.

Parameters

name

A string with the name of the list we are creating. If used in combination with the embedHTML or replaceTemplateVariableByHTML methods the name given to the new custom list has to coincide with the list style name that we want to override.

options

The options array includes an array for each list level that we wish to customize.

key Type Description
type string
  • none
  • bullet
  • decimal
  • upperRoman
  • lowerRoman
  • upperLetter
  • lowerLetter
  • ordinal
  • cardinalText
  • ordinalText
bold bool If true use bold characters.
color string Hexadecimal color value: 'FF0000', '000000', ...
font string Font family. This allows the customization of bullets.
fontSize int Font size in points.
format string The default one is '%1.' for first level, '%2' for second level and so long so forth.
hanging int The extra space for the numbering, should be big enough to accommodate it, the default is 360.
italic string If true use italics.
left int The left indent. The default value is 720 times the list level.
underline string Underlines. Possible values are: single, words, double, dotted, dash and wave.
Return values

Void.

Code samples

Example #1

The resulting Word document looks like:

Example #2

The resulting Word document looks like: