Foxtable(狐表)用户栏目专家坐堂 → [求助]条码打印


  共有3018人关注过本帖树形打印复制链接

主题:[求助]条码打印

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2015/4/1 15:44:00 [显示全部帖子]

1、代码没有问题;

 

2、如果还不能打印,试试改成这样

 


Dim t As Table =  Tables("条码") '指定数据来源表
Dim idx As Integer = 0
For i As Integer = 0 To t.Rows.count - 1
    Dim doc As New PrintDoc
    doc.PageSetting.Width = 65 '纸张宽度为65毫米
    Doc.PageSetting.Height = 25
    doc.AutoRotate = False
    Dim rg As New prt.RenderGraphics
    Dim Bar As New BarCodeBuilder
    Bar.Symbology = Barpro.Symbology.Code128
   
    Dim r As Row =t.Rows(i)
    Bar.Code = r("条码")
    Bar.HumanReadableText = r("生成条码")
    Bar.CodeAlignment = Barpro.Alignment.BelowLeft
    Bar.Font = New Font("Consolas",11)
    Bar.BarWidth = 0.25
    Bar.BarHeight = 10
    Bar.Text = r("型号")
    Bar.TextFont = New Font("OCR-B-Seagull",CSng(10.5),FontStyle.Bold)
    Bar.TextAlignment = Barpro.Alignment.AboveLeft
    Bar.TopMargin = 1
    Bar.BottomMargin = 1
    Bar.Code128CharSet = Barpro.Code128.B
    rg = new prt.RenderGraphics
    bar.DrawOnCanvas(rg.Graphics,0,0,1)
    rg.x=9
    rg.y = 3
    'rg.Style.Spacing.All = 2
    Doc.Body.Children.Add(rg)
    idx += 1
    Doc.PrinterName = "TSC TTP-244 Pro"
    'Doc.print
    Doc.Preview()
Next


 回到顶部