Replies: 6   Views: 3193
Custom list style in embedhtml
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 24-08-2017 - 11:10


You need to add a class to the ul tag with the numbering ID value. This sample is working fine:

$listOptions = array();
$listOptions[0]['type'] = 'bullet';
$listOptions[0]['format'] = 'G';
$listOptions[0]['color'] = '0a46ba';
$listOptions[0]['font'] = 'Wingdings';
$listOptions[1]['type'] = 'bullet';
$listOptions[1]['color'] = '0a46ba';
$listOptions[1]['format'] = 'F';
$listOptions[1]['font'] = 'Wingdings';

$docx->createListStyle('bullet', $listOptions);

$html = 'a lot of html and a list <ul class="bullet"><li>example</li></ul> and a bit more html';

$docx->embedHTML($html, array('customListStyles' => true));

Which version and license of phpdocx are you using? And what program are you using to open the DOCX? We have tested it using MS Word and LibreOffice 5 and it opens perfectly (you need to install Wingdings font as you are using it).