FPDF in PHP, setX just inserts the first row

I use FPDF to create PDF from PHP, and I have a problem with the Write () function

I use the following code, and I want to backtrack from a text block not only on the first line:

$pdf->SetX(60);
$pdf->Write(5,'' . str_repeat( ' This is a test of setX.', 30 ));

but as you can understand, these are just the indents of the first line, any idea on how to move all the mas text?

+3
source share
1 answer

One solution is to use MultiCell insted in Write:

$pdf->SetX(60);    
$pdf->MultiCell(60, 6, '' . str_repeat( ' This is a test of setX.', 30 ));
+6
source

Source: https://habr.com/ru/post/1739443/


All Articles