Forum


Replies: 3   Views: 2012
How to get nested numeric lists?
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 rapidtech  · 27-11-2019 - 09:06

Thank you, it's working fine. One more moment, after generating a DOCX I need to transform it to PDF. But the resulted PDF file instead of numbers has bullets. I need the exact same look

$docx = new CreateDocx();

$decimalOptions = array();
$decimalOptions[0]['type'] = '1';
$decimalOptions[0]['format'] = '%1.';
$decimalOptions[1]['type'] = '1';
$decimalOptions[1]['format'] = '%1.%2.';
$decimalOptions[2]['type'] = '1';
$decimalOptions[2]['format'] = '%1.%2.%3';
$docx->createListStyle('decimal', $decimalOptions);

$html = '
<ol class="decimal">
    <li>First item.</li>
    <li>Second item with subitems:
        <ol>
            <li>First subitem.</li>
            <li>Second subitem.
                <ol>
                    <li>First subitem.</li>
                    <li>Second subitem.</li>
                </ol>
            </li>
        </ol>
    </li>
    <li>Third subitem.</li>
</ol>';
$docx->embedHTML($html, array('customListStyles' => true));
$docx->createDocx('test.docx');


$transform = new TransformDocAdvPDF('test.docx');
$transform->transform('test.pdf');