PDF_fit_textflow

(PECL pdflib:2.0-2.1.3)

PDF_fit_textflow — Format textflow in rectangular area

Описание

string PDF_fit_textflow ( resource $pdfdoc , int $textflow , float $llx , float $lly , float $urx , float $ury , string $optlist )

Formats the next portion of a textflow into a rectangular area.

Коментарии

Автор:
to plant an singel line with an alignment

$textflow = pdf_create_textflow($pdf, "test 123\nfoo baaa", 'fontname=Helvetica fontsize=12 encoding=iso8859-1 alignment=right');   
  pdf_fit_textflow   ($pdf, $textflow, 400, 100, 550, 200, '');
  pdf_delete_textflow($pdf, $textflow);
2006-05-17 07:53:54
http://php5.kiev.ua/manual/ru/function.pdf-fit-textflow.html
This is an excerpt of code from the PDFlib Manual that has been modfied for PHP.  It fulfills the very common need to have a textflow extend accross multiple pages.

$pdf is the PDF file resource.  You may want to modify the page size (this is letter size) or the position of the textflow itself. 

<?php

$thetext 
"INSERT YOUR MULTI-PAGE TEXT HERE";

$textflow PDF_create_textflow($pdf$thetext"fontname=Tahoma fontsize=9 encoding=winansi");

do {
   
PDF_begin_page_ext($pdf612792"");
   
$result PDF_fit_textflow($pdf$textflow50120550720"");
   
PDF_end_page_ext($pdf"");
} while (
strcmp($result"_stop"));

PDF_delete_textflow($pdf$textflow);

?>

If you have any templates or pagination that need to be placed on each page, they can go within the do/while loop itself, between the begin_page and end_page functions.
2006-08-13 15:10:23
http://php5.kiev.ua/manual/ru/function.pdf-fit-textflow.html
Автор:
NOTE!
This function is not supported in "PDFlib Lite" extension which is mostly been used by PHP-programmers.
2007-11-19 07:16:56
http://php5.kiev.ua/manual/ru/function.pdf-fit-textflow.html
Автор:
As of v8 or v9 of PDFlib, some things have changed concerning pdf_fit_textflow . The example (2 posts above) which makes textflow extend accross multiple pages, may be necessary to be changed in this way:

do {
   
      ....

} while(strcmp($result, "_boxfull") == 0);
2014-11-28 09:42:43
http://php5.kiev.ua/manual/ru/function.pdf-fit-textflow.html
Автор:
fit_textflow($tf, x_coord, y_coord, w_coord, h_coord, $opt)
    x_coord - number of pixels from the left
    y_coord - number of pixels from the bottom of the text box to the bottom of the PDF
    w_coord - number of pixels from the left to the right side of the box
    h_coord - number of pixels from the bottom of the PDF to the top of the text box
2017-11-09 17:40:21
http://php5.kiev.ua/manual/ru/function.pdf-fit-textflow.html

    Поддержать сайт на родительском проекте КГБ