in reply to PDF::API2 - Test text that will fit in area

There is a method called textpos() which returns the current estimated text position. Perhaps you can use that to work out the size.

See: PDF::API2::Content