Question

How would I put padding between a string and the border to said string in TCPDF. I'm not seeing any way to do that in the Text() method.

Do I have to use another method? Is there anyway to accomplish this?

This would be an example of code I'm using:

$pdf->Text(130, $margintop, $fieldkey, false, false, true, 'B', 0, '', false, '', 0, false, 'B', 'T', false);
Was it helpful?

Solution

TCPDF assigned default-values to the cell-paddings, which can be overwritten:

$pdf->setCellPaddings( $left = '', $top = '', $right = '', $bottom = '');

Or, with using the same padding for all sides:

$pdf->setCellPadding( $padding );

See the documentation here: http://www.tcpdf.org/doc/code/classTCPDF.html#a374b24751bf76e4ca5ba7694f87ec2c1

Update 22.04.2020: https://tcpdf.org/docs/srcdoc/TCPDF/class-TCPDF/#_SetCellPadding

Update 20.08.2020: https://tcpdf.org/docs/srcdoc-copy/TCPDF/class-TCPDF/#_SetCellPadding

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top