How to calculate the string width in iText?

Viewed 34718

I am using iText to write a PDF. In some cases, I need to sign the PDF with the SetVisibleSignature function. With this function, we need to designate the rectangle that we will write the content into.

But it's hard for me to calculate how wide the string will be, so that I can set the rectangle before setting a signature on the PDF.

How can I calculate the string width in iText?

3 Answers
Related