您好,抱歉,請問一下,
TextBox3.Text,內容為中文,這樣的方式,中文會變亂碼。
程式碼如下:
'Create one page
'Dim page As PdfPageBase = doc.Pages.Add(PdfPageSize.A4, margin)
Dim page As PdfPageBase = doc.Pages(Wk_Loop)
Dim brush As 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(TextBox3.Text, New PdfFont(PdfFontFamily.Helvetica, 24), PdfBrushes.Violet, 0, 0, New PdfStringFormat(PdfTextAlignment.Center))
brush.Graphics.Restore()
brush.Graphics.SetTransparency(1)
page.Canvas.DrawRectangle(brush, New RectangleF(New PointF(0, 0), page.Canvas.ClientSize))
謝謝。