Break line in a PHP FPDF class Cell?

Asked

Viewed 6,199 times

1

I would like to know how to insert a line break with the FPDF of PHP. I’m putting the following code:

$pdf->Cell(0,20, "Declaramos que ".$nome.$quebra_linha." participou da I SAEP - Semana Acadêmica \n de Engenharia de Produção....",0,0,'L');

but the continuation of the line continues on the first line and leaves the PDF. Insert another Cell below the first, with the continuation of the text is also an option, but I am not able to do.

3 answers

2

For line breaking or commando Multicell:

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

$pdf->MultiCell(0, 20, $texto,0,'L', false);

See detailed settings on link.

Handbook of FPDF

-2

For line breaking the Multicell command:

MultiCell(float w, float h, string txt [, mixed border [, string align [, boolean fill]]])
$pdf->MultiCell(0, 20, $texto,0,'L', false);"

-2

Uses the Multicell command. It will break the line when the width of the contents exceeds the parameter "w" passed to this function.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.