Calculate text height based on available width and font?

前端 未结 8 1522
醉酒成梦
醉酒成梦 2020-12-16 13:11

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 use

8条回答
  •  萌比男神i
    2020-12-16 13:57

    In .NET you can call Graphics.MeasureString to find out how large the drawn text is going to be.

提交回复
热议问题