PHP: word wrap the text inside the PDF?
Would you know how to word wrap the text inside the PDF? I am using an array like:
$email_message =" fax: ".clean_strin开发者_如何学Gog($fax)."\n
"; $email_message .=" address: ".clean_string($address)."\n"; $email_message .=" email: ".clean_string($email)."\n";but the break tags show up within the PDF, I would like each one to go on a new line. I am using FPDF & Pear's Mime classes to generate the PDF.
with a loop you can go through the
$posY = $pdf->GetY();
$nl = 4.5;
$temptext = explode("\n",$email_message );
foreach($temptext as $newline) {
$pdf->Text(10,$posY+$nl,$newline);
$nl += 4.5;
}
精彩评论