We are creating PDF documents on the fly from the database using PDFsharp.
I need to know the best way to calculate the height of the text area based on the font used and the available width.
I need to know the height so I can process page breaks when required.
I had a similiar problem so I implemented this extension method:
In .NET you can call Graphics.MeasureString to find out how large the drawn text is going to be.