Footer Text Problems

185 views
Skip to first unread message

Gorka Leguina

unread,
Jan 26, 2010, 1:11:09 PM1/26/10
to dompdf
Hi,

Does anyone knows how to set a paragraph on a footer made with <script
type="text/php">:

Got a very long text and I'm using $pdf->text: is there any method to
determine where the text has to do a page break, like using \n...??

I try different ways... but no succes.

Thnx!!!

Gorka Leguina.

BrianS

unread,
Jan 28, 2010, 3:10:03 PM1/28/10
to dompdf

This is something you'll have to do manually. The best the methods
available through inline scripting can do is tell you how wide your
line is. You basically would need to test the width of a substring of
your text at the desired font size, split the string at that point,
then do again with the remainder of the text.

I wrote up some code that will do what you want. It's a bit messy (I
wrote it over lunch), but it appears to work.

Check out the HTML document, which contains the inline script:
http://eclecticgeek.com/dompdf/debug_tests/70a373b42d6e4cde.htm

and here's the resulting PDF:
http://eclecticgeek.com/dompdf/index.php?input_file_http=&input_file=70a373b42d6e4cde.htm&paper=&orientation=&dompdf_ver=trunk&load_method=1&submit=submit

-b

Gorka Leguina

unread,
Jan 29, 2010, 3:41:59 AM1/29/10
to dompdf
Hi,

Yes, that's the solution I implemented. Different from yours, but with
the result I wanted.

Thank you anyway Bryan.

Gorka Leguina.

> and here's the resulting PDF:http://eclecticgeek.com/dompdf/index.php?input_file_http=&input_file=...
>
> -b

Reply all
Reply to author
Forward
0 new messages