note 46180 added to function.pdf-show-xy
| From: | sigve at NwOoSlPfArMaidah dot no | Date: | Fri, 01 Oct 2004 14:21:05 +0000 |
| Subject: | note 46180 added to function.pdf-show-xy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-77684@lists.php.net to get a copy of this message | ||
Want to do right-to-left text with pdflib? Just pick the right margin, and send it as $x to this
function.
<?php
function pdf_show_xy_backwards ($pdf, $text, $font, $size, $x, $y) {
$currx = $x;
for ($i = strlen($text); $i > 0; $i--) {
$char = substr((string)$text, $i-1, 1);
$width = pdf_stringwidth($pdf, (string)$char, $font, $size);
$currx = $currx - $width;
pdf_show_xy($pdf, (string)$char, $currx, $y);
}
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.pdf-show-xy.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46180
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46180&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46180&report=yes
Search -- http://master.php.net/manage/user-notes.php