XML API - pdx:addList

pdx:addList

Inserts (nested) lists into the Word document.

Note

You are reading the XML API documentation. For the PHP API method please go to addList.

Description

Element definition

This element allows the insertion of lists (numbered or with bullets) into your Word document.

You may also include nested lists by means of nested arrays of data and fully customize its contents with the use of WordML fragments.

The following style types are always available:

  • Clear: with no bullets or indentation. This is the default value.
  • Unordered: the standard bulleted list of Word or HTML ul tag.
  • Ordered: the standard ordered list of Word or HTML ol tag.

You may also check all the current available lists styles of your phpdocx base template by means of the parseStyles element. This element returns a Word document including the required phpdocx code to insert the lists that are generated within that document.

You may also use the list styles created via the createListStyle element using the name you gave to your custom list.

Attributes and sub-elements

listType

(mixed), 0 (clear), 1 (inordinate) (default), 2 (numerical) or the name of the created list

options

The possible keys and values are (required options are shown with yellow background):

Key Description
bold If true the text will be shown in bold characters.
caps If true displays text in capital letters.
color Hexadecimal color value: 'FF0000', '000000'...
font Font family: 'Arial', Calibri'...
fontSize Font size in points.
highlightColor Highlights the run of text. The available colors are: black, blue, cyan, green, magenta, red, yellow, white, darkBlue, darkCyan, darkGreen, darkMagenta, darkRed, darkYellow, darkGray, lightGray, none.
italic If true displays the text in italics.
pStyle Word style to be used. Run parseStyles() method to check all available paragraph styles.
rtl Sets to true for right to left languages like Hebrew or Arabic.
smallCaps If true displays text in small capital letters.
underline Underlines text. Possible values are: single, words, double, dotted, dash and wave.
useWordFragmentStyles Use WordFragment paragraph styles.
Code samples

Example #1

config.xml

content.xml

settings.xml

PHP code

The resulting Word document looks like: