Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: PDF_fit_textflow - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net

search for in the

PDF_fit_textline" width="11" height="7"/> <PDF_fit_pdi_page
Last updated: Sat, 06 May 2006
view this page in

PDF_fit_textflow

(PECL)

PDF_fit_textflow -- textflow を矩形領域に配置する

説明

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

textflow の次の部分を、矩形領域に配置します。



add a note add a note User Contributed Notes
PDF_fit_textflow
ctemple at xadvance dot com
14-Aug-2006 04: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-May-2006 08: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);

 
show source | credits | sitemap | contact | advertising | mirror sites