以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  条形码打印控制  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=65875)

--  作者:HJG_HB950207
--  发布时间:2015/3/24 19:36:00
--  条形码打印控制
请教:按如下代码批量打印生存的条形码,1.如何在打印的码下面附上 姓名;2.条码大小如何控制。谢谢了!

Dim doc As New PrintDoc
Dim rg As prt.RenderGraphics
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
For Each r As Row In Tables("职工一览表").Rows
  bar.CodE ="姓   名:" & r("姓名") & Chr(13) & Chr(10) & "出生时间:" & r("出生时间")
                                                                                                                                                                                                          rg = new prt.RenderGraphics
    bar.DrawOnCanvas(rg.Graphics,0,0,1)
    rg.Style.Spacing.All = 3
    Doc.Body.Children.Add(rg)
Next
Doc.Preview()

--  作者:有点酸
--  发布时间:2015/3/24 21:39:00
--  
先看看:
http://www.foxtable.com/help/topics/2081.htm
http://www.foxtable.com/help/topics/2083.htm

设置好之后,可以用这个自动生成代码:
http://www.foxtable.com/help/topics/2092.htm

根据生成的代码,来修改自己的代码:

Dim doc As New PrintDoc
Dim rg As prt.RenderGraphics
Dim Bar As New BarCodeBuilder
Bar.Symbology = Barpro.Symbology.QRCode
Doc.Stacking = prt.StackingRulesEnum.InlineLeftToRight
For Each r As Row In Tables("职工一览表").Rows
     bar.Cod ="姓   名:" & r("姓名") & Chr(13) & Chr(10) & "出生时间:" & r("出生时间")
     Bar.Text = r("姓名")
    rg = new prt.RenderGraphics
    bar.DrawOnCanvas(rg.Graphics,0,0,1)
    rg.Style.Spacing.All = 3
    Doc.Body.Children.Add(rg)
Next
Doc.Preview()



[此贴子已经被作者于2015/3/24 21:39:58编辑过]

--  作者:HJG_HB950207
--  发布时间:2015/3/24 21:39:00
--  
谢谢!
--  作者:有点酸
--  发布时间:2015/3/24 21:41:00
--  
调整尺寸的是:

Bar.QRCodeModuleSize = 2