开发者

FPDF in PHP, setX just indents first row

开发者 https://www.devze.com 2022-12-25 14:15 出处:网络
I use FPDF to creat PDF from PHP and i have a problem with the Write() function i use the following code and i want to indent the text block not just the first row:

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

i use the following code and i want to indent the text block not just the first row:

$pdf->SetX(60);
$pdf->Write(5,'' . str_repeat( ' This is a test of setX开发者_开发技巧.', 30 ));

but as you can understand it's just indents the first row, any idea on how to move the whole text mas?


One solution is to use MultiCell insted of Write:

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

精彩评论

暂无评论...
验证码 换一张
取 消