Dim t As New prt.RenderTable()
With t
.Width = 25
.Height = 50
.Style.GridLines.All = New prt.LineDef '设置网格线
.Rows.Count = 1 '设置总行数
.Cols.Count = 2 '设置总列数
'
'.Rows(0).Height = 30 '二维码
'.Rows(1).Height = 10 '
.Cols(0).Width = 15
.Cols(1).Width = 5
'
'.Cells(0, 0).SpanCols = 2 '零件号
'.Cells(1, 0).SpanRows = 2 '文字
End With
Dim cell As prt.RenderArea
Dim rt As prt.RenderText
'二维码
cell = t.Cells(0, 0).Area
Dim rg As prt.RenderGraphics
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Bar.QuietZoneWidth = 0 '把静区宽度设置为0
Bar.DisplayCode = False
Bar.Code = mid_pack_code
rg = New prt.RenderGraphics
rg.Width = 15
rg.Height = 15
'rg.Style.BackColor = Color.Red
rg.Style.Padding.Top = 0.5
rg.Style.Padding.Left = 0.5
rg.Style.Padding.Right = 0.5
rg.Style.Padding.Bottom = 0.5
Bar.DrawOnCanvas(rg.Graphics, 0, 0, 1)
'rg.style.TextAngle = 90
cell.Children.Add(rg)
cell = t.Cells(0, 1).Area
rt = New prt.RenderText()
'rt.Style.BackColor = Color.yellow
rt.Style.TextAlignHorz = prt.AlignHorzEnum.left '水平左对齐
'rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rt.Height = 5
rt.Style.Font = New Font("宋体", 9, FontStyle.Bold) '设置字体
rt.Text = sn
rt.style.TextAngle = 90
cell.Children.Add(rt)