Line height in fpdf multicell

janenz00 picture janenz00 · Mar 22, 2012 · Viewed 42.2k times · Source

I am using fpdf multicell to display an address. Each line in the address will be displayed in a new line like :

           102 South Avenue
           Suite 107
           Scottsdale AZ 85260
           111-000-1111

But the line height between each line is more than a new line. Any idea how to set the line height for MultiCell in FPDF?

Answer

bboydev picture bboydev · Feb 21, 2013

Height is height of each text line in multicell, not height of whole multicell element.

What multiCell does is to spread the given text into multiple cells, this means that the second parameter defines the height of each line (individual cell) and not the height of all cells as a collective.

MultiCell(float w, float h, string txt [, mixed border [, string align [, boolean fill]]])

You can read the full documentation here.