PHP and PDF
Posted: Sun Feb 01, 2004 12:49 pm
Hi, i don't know if this is good to be here. You can move it anytime
I have a class that creates PDF files on the fly and it works fine. The only problem is that i can't add line feeds.
I want to create pdfs that will hold text which exist in my database. So i do something like this:
The result is :
blah.. blah.. blah.. blah.. blah.. blah.. blah.. blah.. blah..
instead of :
blah.. blah.. blah..
blah.. blah.. blah..
blah.. blah.. blah..
blah.. blah.. blah..
This makes the text flow out of the pdf screen
Any help???
I tried <br>, \n, \r\n, \r
but nothing.
Is there a special char that says to pdfs to create a line feed???
I have a class that creates PDF files on the fly and it works fine. The only problem is that i can't add line feeds.
I want to create pdfs that will hold text which exist in my database. So i do something like this:
Code: Select all
<?php
$pdf->text(100, 100, "$headline"); // Text at x=100 and y=100.
$pdf->setFont('Arial', 'BI', 9);
$pdf->text(100, 130, "by $writer");
$pdf->text(50, 170, "$intro");
$pdf->text(50, 200, "$story");
?>blah.. blah.. blah.. blah.. blah.. blah.. blah.. blah.. blah..
instead of :
blah.. blah.. blah..
blah.. blah.. blah..
blah.. blah.. blah..
blah.. blah.. blah..
This makes the text flow out of the pdf screen
Any help???
I tried <br>, \n, \r\n, \r
but nothing.
Is there a special char that says to pdfs to create a line feed???