我们都在从数据库中动态创建PDF文档使用 PDFsharp 。
我需要知道计算文本区域的基于高度的最佳方式 所用的字体和可用宽度
我需要知道的高度,以便在需要时我可以处理分页符。
解决方案在.NET中你可以调用 Graphics.MeasureString找出如何 大绘制的文本将是。
右,但使用PDFsharp当你调用XGraphics.MeasureString。
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.
解决方案In .NET you can call Graphics.MeasureString to find out how large the drawn text is going to be.
Right, but when using PDFsharp you call XGraphics.MeasureString.