Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Nov 07, 2017 6:03 am

PdfTilingBrush brush
= new PdfTilingBrush(new SizeF(page.Canvas.ClientSize.Width / 2, page.Canvas.ClientSize.Height / 3));
brush.Graphics.SetTransparency(0.3f);
brush.Graphics.Save();
brush.Graphics.TranslateTransform(brush.Size.Width / 2, brush.Size.Height / 2);
brush.Graphics.RotateTransform(-45);


brush.Graphics.DrawString("显示测试",
new PdfFont(PdfFontFamily.Symbol, 24), PdfBrushes.Violet, 0, 0,
new PdfStringFormat(PdfTextAlignment.Center),true);

1024963027@qq.com
 
Posts: 1
Joined: Tue Nov 07, 2017 5:59 am

Tue Nov 07, 2017 8:15 am

Hello,

Thanks for your inquiry.
需要使用能支持中文的字体才能显示中文,下面是相关代码。
Code: Select all
 brush.Graphics.DrawString("显示测试",new PdfTrueTypeFont(new Font("宋体", 24f),true), PdfBrushes.Violet, 0, 0,
                new PdfStringFormat(PdfTextAlignment.Center));


Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.PDF