Dim txt1 As String = e.Form.Controls("TextBox1").Text
Dim cmb1 As String = e.Form.Controls("ComboBox1").Text
Dim doc As New PrintDoc
Dim rg As prt.RenderGraphics
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.Code128
Bar.BarWidth = 0.25 '窄条宽度
Bar.BarRatio = 2.3 '设定宽窄比例
Bar.BarHeight = 5 '设定条码高度
Bar.QuietZoneWidth = 2 '静区宽度
Dim t As Table = Tables("商品资料")
Dim ra As prt.RenderArea
For i As Integer = t.TopPosition To t.BottomPosition
Dim r As Row = t.Rows(i)
For j As Integer = 0 To val(txt1) - 1
If j Mod 3 = 0 Then
ra = new prt.RenderArea
Doc.Body.Children.Add(ra)
End If
bar.Code = r("条码号")
Bar.QuietZoneWidth = 2
Bar.CodeAlignment = Barpro.Alignment.BelowJustify
Bar.Text = "BOBOYA ¥" & r("零售价") & "元" '条码上方文本说明
Bar.TextAlignment = Barpro.Alignment.AboveLeft
rg = new prt.RenderGraphics
bar.DrawOnCanvas(rg.Graphics,0,0,1)
rg.Style.Spacing.All = 3
ra.Stacking = prt.StackingRulesEnum.InlineLeftToRight
ra.Children.Add(rg)
Next
Next
Doc.PrinterName = cmb1
Doc.Preview() '打印预览