PHP Doku:: Passt Textfluss in rechteckigen Bereich ein - function.pdf-fit-textflow.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzNon-Text MIME-AusgabenPDFPDF FunktionenPDF_fit_textflow

Ein Service von Reinhard Neidl - Webprogrammierung.

PDF Funktionen

<<PDF_fit_table

PDF_fit_textline>>

PDF_fit_textflow

(PECL pdflib >= 2.0.0)

PDF_fit_textflowPasst Textfluss in rechteckigen Bereich ein

Beschreibung

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

Gibt den nächsten Abschnitt eines Textflusses in einen rechteckigen Bereich aus.


3 BenutzerBeiträge:
- Beiträge aktualisieren...
David
19.11.2007 14:16
NOTE!
This function is not supported in "PDFlib Lite" extension which is mostly been used by PHP-programmers.
ctemple at xadvance dot com
13.08.2006 21:10
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($pdf, 612, 792, "");
   
$result = PDF_fit_textflow($pdf, $textflow, 50, 120, 550, 720, "");
   
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.
GreenRover
17.05.2006 13:53
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);



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)