开发者

fpdf and new line

why text don't jump to new line?

http://img826.imageshack.us/img826/2097/pdf.png

My code:

<?php
require('fpdf.php');

$pdf=new FPDF('P','mm','A4');
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World! Hello World! Hello World! Hello World! Hello World!Hello World!Hello World!','LRTB');
$pdf->Cell(40,10,'Hello World! Hello World! Hello World! Hello World! Hello World!Hello World!Hello World!','LRTB');
$pdf->Cell(40,10,'Hello World! Hello World! Hello World! Hello World! Hello World!Hello 开发者_开发技巧World!Hello World!','LRTB');
$pdf->Ln();
$pdf->Cell(40,10,'Hello World! Hello World! Hello World! Hello World! Hello World!Hello World!Hello World!','LRTB');
$pdf->Cell(40,10,'Hello World! Hello World! Hello World! Hello World! Hello World!Hello World!Hello World!','LRTB');
$pdf->Cell(40,10,'Hello World! Hello World! Hello World! Hello World! Hello World!Hello World!Hello World!','LRTB');
$pdf->Output();
?>


The "Hello World" strings are printing across the cell borders.

If you want text to wordwrap inside a cell try using the MultiCell() method.


Try one more argument at the end (ln=2)

$pdf->Cell(40,10,'Hello World! Hello World! Hello World! Hello World! Hello World!Hello World!Hello World!','LRTB', 2);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜