Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FPDF multicell alignment not working

Tags:

php

fpdf

I have this multicell in my pdf:

$pdf->multicell(115,6,$name,1,0,'L',1);

But it turns out that the text is right aligned instead of left aligned.

I found the same problem here but I don't get his solution, what does "I had to set any font" mean? I can't comment on his answer because my reputation's not enough to give comments.

like image 276
Marsha Avatar asked Dec 15 '22 06:12

Marsha


2 Answers

The method MultiCell gets at most 6 arguments, not 7. The problem here is, that you supply 0 for alignment, not 'L'. See the documentation for details.

like image 99
Abrixas2 Avatar answered Dec 30 '22 00:12

Abrixas2


this is the Syntax for Multicell

$pdf->MultiCell(100,3,"We declare " ,1,'L',false);

you can do it now

like image 45
Smoke Avatar answered Dec 29 '22 23:12

Smoke