note 38393 rejected from function.pdf-stringwidth by didou

From: Date: Mon, 10 Jan 2005 00:57:34 +0000
Subject: note 38393 rejected from function.pdf-stringwidth by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-83012@lists.php.net to get a copy of this message
Note Submitter: sa_kelkar at yahoo dot com ---- This will align the text in center of the start and end position pass to function. It works for only 2 ines. i try to convert it in recursive but i can't so help me for this regards function central($pdf,$xstart,$xend,$string,$y) { //sa_kelkar@yahoo.com // if any one can convert itto recursive then please mail back $dd=pdf_stringwidth ($pdf,trim($string)); $diff=$xend-$xstart; if ($dd<$diff) { $x=$diff/2-$dd/2; pdf_show_xy($pdf,$string,$x,$y); } else { $dd1=0; for ($z=1;$dd1<$diff;$z++) { $Tstring=substr($string,0,$z); $dd1=pdf_stringwidth($pdf,$Tstring); } $kk=substr($string,0,$z);//strlen($Tstring)); pdf_show_xy($pdf,$kk,$xstart,$y); $dd1=pdf_stringwidth ($pdf,trim(substr($string,$z))); $x=$diff/2-$dd1/2; pdf_show_xy($pdf,substr($string,$z),$x,$y-20); } }

« previous php.notes (#83012) next »