Line break in FPDF PHP

1k Views Asked by At

for example i have an address string like

John <br/> xxxxx <br/> AAAAA <br/> 104 

I tried to display this address in pdf file using FPDF library,

$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times','',12);
$pdf->SetTextColor(32);
 $pdf->SetFillColor(255, 255, 255);
$pdf->MultiCell(0,5,nl2br($address),0,1,'L');

But its print same as in string, no line break is coming. is there any solution

1

There are 1 best solutions below

3
On

You need to use \n as new line. And it should be quoted with " "