Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/bpampuch/pdfmake/llms.txt

Use this file to discover all available pages before exploring further.

pdfmake supports both unordered (bulleted) and ordered (numbered) lists as first-class content nodes. Each list is defined with a single property — ul for unordered and ol for ordered — whose value is an array of items. Items can be plain strings, styled text objects, or even nested lists.

Unordered lists

Use { ul: [...] } to create a bulleted list:
const docDefinition = {
  content: [
    {
      ul: [
        'item 1',
        'item 2',
        'item 3'
      ]
    }
  ]
};
Long lines wrap correctly and the bullet remains aligned to the first line:
{
  ul: [
    'item 1',
    'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Malit profecta versatur nomine ocurreret multavit',
    'item 3'
  ]
}

Ordered lists

Use { ol: [...] } to create a numbered list:
{
  ol: [
    'item 1',
    'item 2',
    'item 3'
  ]
}

Ordered list options

Start value

start sets the first counter value:
{
  start: 50,
  ol: [
    'item 1',  // renders as "50."
    'item 2',  // renders as "51."
    'item 3'   // renders as "52."
  ]
}

Reversed list

reversed: true counts down instead of up:
{
  reversed: true,
  ol: [
    'item 1',  // renders as "3."
    'item 2',  // renders as "2."
    'item 3'   // renders as "1."
  ]
}

Counter type

The type property changes the numbering scheme:
{ type: 'lower-alpha', ol: ['item 1', 'item 2', 'item 3'] }
// renders: a. b. c.

Custom separator

separator changes the characters that wrap the counter. A string places a suffix; a two-element array adds both prefix and suffix:
// Suffix only → "1)"
{ separator: ')', ol: ['item 1', 'item 2', 'item 3'] }

// Prefix and suffix → "(1)"
{ separator: ['(', ')'], ol: ['item 1', 'item 2', 'item 3'] }

Per-item counter override

Each item can override the counter value with counter:
{
  ol: [
    { text: 'item 1', counter: 10 },   // renders as "10."
    { text: 'item 2', counter: 20 },   // renders as "20."
    { text: 'item 3', counter: 30 },   // renders as "30."
    { text: 'item 4 without own value' } // continues from 31
  ]
}

Unordered list bullet style

The type property also controls the bullet shape for ul:
// Square bullets
{ type: 'square', ul: ['item 1', 'item 2', 'item 3'] }

// Open-circle bullets
{ type: 'circle', ul: ['item 1', 'item 2', 'item 3'] }

// No bullets
{ type: 'none', ul: ['item 1', 'item 2', 'item 3'] }

Per-item list type

Individual items can override the list type using listType:
{
  ul: [
    'item 1',
    { text: 'item 2', listType: 'none' },    // no bullet
    { text: 'item 3', listType: 'circle' }   // open circle
  ]
}
{
  ol: [
    'item 1',
    { text: 'item 2', listType: 'none' },        // no number
    { text: 'item 3', listType: 'upper-roman' }  // III.
  ]
}

Marker color

markerColor sets the color of the bullet or number independently from the item text. It can be applied at the list level or per item:
{
  color: 'blue',       // text color for all items
  markerColor: 'red',  // bullet/number color for all items
  ul: [
    'item 1',
    'item 2',
    { text: 'item 3 with custom marker color', markerColor: 'lime' }
  ]
}

Nested lists

Any list item can contain a nested ul or ol node. pdfmake indents the inner list automatically:
{
  ol: [
    'item 1',
    [
      'Parent item with sub-list',
      {
        ol: [
          'subitem 1',
          'subitem 2',
          'subitem 3 - Lorem ipsum dolor sit amet ...'
        ]
      }
    ],
    'item 3\nsecond line of item 3'
  ]
}
You can mix ol and ul at any depth:
{
  ol: [
    'item 1',
    'Lorem ipsum dolor sit amet ...',
    {
      ul: [
        'subitem 1',
        'subitem 2',
        'subitem 3 - Lorem ipsum dolor sit amet ...'
      ]
    },
    'item 3\nsecond line of item3'
  ]
}
When nesting, the parent list item and the nested list are placed inside an array [...]. This array acts as a vertical stack — the first element is the parent item text, the second is the nested list.

Lists inside columns

Lists work inside columns nodes just like any other content:
{
  columns: [
    {
      ul: [
        'item 1',
        'Lorem ipsum dolor sit amet, consectetur adipisicing elit ...'
      ]
    },
    {
      ol: [
        'item 1',
        'Lorem ipsum dolor sit amet, consectetur adipisicing elit ...'
      ]
    }
  ]
}

Styling list items

Apply any text property to a list item object. Items inherit styles from the enclosing list node:
{
  color: 'blue',
  ol: [
    { text: 'Styled item', bold: true, fontSize: 14 },
    'Regular item',
    { text: 'Custom color item', color: 'green' }
  ]
}
Set style: 'myStyle' on the list node itself to apply a named style to all items at once, then override individual items as needed.

Build docs developers (and LLMs) love