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);
}
}
?>