TCPDF Item List Fields

Couldn't find it anywhere. Having a list:

<ol>
    <li>Foo</li>
    <li>Bar</li>
    <li>Baz</li>
</ol>

      

and CSS:

ul li, ol li{
    margin-bottom: 10px;
}

      

The list is margin-bottom

interpreted correctly when viewed in a browser . Unfortunately, TCPDF

somehow it doesn't recognize this style (while recognizing other parts of the included css file). Is there a trick / hack to make it work?

+3


source to share


1 answer


tcpdf allows you to define vertical spaces for HTML tags, see the setHtmlVSpace method on the TCPDF class documentation , use:

$pdf->setHtmlVSpace(array(
    'li' => array(
        'h' => 5, // margin in mm
    ) 
));

      



The html-Element name is the key (li) and h indicates the vertical space

+4


source







All Articles