的基础上计算可用宽度和字体文字高度?基础上、宽度、高度、字体

2023-09-04 00:15:13 作者:等句你爱我等到炫迈都没味

我们都在从数据库中动态创建PDF文档使用 PDFsharp 。

我需要知道计算文本区域的基于高度的最佳方式 所用的字体和可用宽度

我需要知道的高度,以便在需要时我可以处理分页符。

解决方案   

在.NET中你可以调用   Graphics.MeasureString找出如何   大绘制的文本将是。

右,但使用PDFsharp当你调用XGraphics.MeasureString。

word字体高度与实际尺寸怎么算

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.