Afn*_*hir 26 pdf newline pdfsharp
我试图获得新的行,但如果我使用\n它没有任何方式通过添加字符串像\r\n(不起作用)有新的行
gfx.DrawString("Project No \n" + textBoxProjNumber.Text, fontUnder, XBrushes.Black, 230, 95);
Run Code Online (Sandbox Code Playgroud)
不起作用.
Je *_*not 29
你试过XTextFormatter类吗?
见这里:http: //www.pdfsharp.net/wiki/TextLayout-sample.ashx
代码段:
PdfDocument document = new PdfDocument();
PdfPage page = document.AddPage();
XGraphics gfx = XGraphics.FromPdfPage(page);
XFont font = new XFont("Times New Roman", 10, XFontStyle.Bold);
XTextFormatter tf = new XTextFormatter(gfx);
XRect rect = new XRect(40, 100, 250, 220);
gfx.DrawRectangle(XBrushes.SeaShell, rect);
tf.DrawString(text, font, XBrushes.Black, rect, XStringFormats.TopLeft);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
22153 次 |
| 最近记录: |