in reply to Re^2: Add text field to PDF
in thread Add text field to PDF

Solved. Using

my $width = $text-> advancewidth( $string );

but remembering to use the same font in $text and $annotation works fine!