Hi,
Is it not possible to set tabPositions when using addText method on a wordFragment which is then included as a list item?
The following code should do it:
$docx = new CreateDocx();
$textData = new WordFragment($docx);
$tabs = array();
$tabs[] = array('position' => 4000, 'leader' => 'dot');
$tabs[] = array('position' => 6000, 'leader' => 'dot');
$tabs[] = array('position' => 8000, 'leader' => 'dot');
$options = array('tabPositions' => $tabs);
$text = array();
$text[] = array('text' => 'one');
$text[] = array('text' => 'two', 'tab' => true);
$text[] = array('text' => 'three', 'tab' => true);
$textData->addText($text, $options);
$itemList= array(
'In this example we use a custom list (val = 5) that comes bundled with the default PHPdocX template.',
array(
$textData,
'Line B',
'Line C'
),
'Line 3',
);
// set the style type to 5: other predefined Word list style
$docx->addList($itemList, 5);
$docx->createDocx('example_addList_3');
The tabs work fine if i run $docx->addText($text, $options); and then just create the document, but it does not work as expected when running $textData->addText($text, $options); and then including $textData as a list item.
Any idea/workaround?
Thanks.