Using the code from this answer, you can calculate the width of the text you want to draw based on the font and font size. Once you have the width of the string you can right justify it based on the width of the page.
$text = 'Some text to right align';
$textWidth = getTextWidth($text, $zendPdfFont, $fontSize);
$page->drawText($text,
$page->getWidth() - $textWidth - $fontSize,
$verticalPosition);
Similarly to center it:
$page->drawText($text,
($page->getWidth() / 2) - ($textWidth / 2),
$verticalPosition);