in reply to Re^2: Add text field to PDFin thread Add text field to PDF
Solved. Using
my $width = $text-> advancewidth( $string ); [download]
but remembering to use the same font in $text and $annotation works fine!