Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TCPDF remove <ul> indenting

For some reason TCPDF is adding space to the left when I use writeHTML() to print an unordered list. By default, the PDF has a margin of 5 (set with $pdf->SetMargins(5, 0, 10, true);) but list items get indented.

I set $pdf->setCellPaddings(0,0,0,0); already, which prevents with unwanted (minus-)space for <p> tags, but obviously doesn´t affect lists.

The call:

$pdf->writeHTML('<ul><li>...</li></li>...</li></ul>');

The result:

enter image description here

Is there any option I miss?

like image 822
Arne Cordes Avatar asked Nov 18 '13 12:11

Arne Cordes


1 Answers

There is a method setListIndentWidth. For example:

$pdf->setListIndentWidth(4);

You can experiment with the value. And the documentation entry is here.

like image 191
Jojo Avatar answered Nov 15 '22 22:11

Jojo