Foxtable(狐表)用户栏目专家坐堂 → 关于二维码尺寸问题


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

主题:关于二维码尺寸问题

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


加好友 发短信
等级:幼狐 帖子:172 积分:1571 威望:0 精华:0 注册:2021/8/9 16:05:00
关于二维码尺寸问题  发帖心情 Post By:2023/2/16 15:38:00 [显示全部帖子]

rt,二维码的code长度一模一样,生成的二维码大小不一,真是奇怪!

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20230216153556.jpg
图片点击可在新窗口打开查看


 回到顶部
帅哥哟,离线,有人找我吗?
benben325
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:172 积分:1571 威望:0 精华:0 注册:2021/8/9 16:05:00
  发帖心情 Post By:2023/2/16 16:17:00 [显示全部帖子]

这是遍历出来的,而且你可以扫描一下 二维码,我现在截图少而已,后面有重复大 重复小的 ,没有规律!

 回到顶部
帅哥哟,离线,有人找我吗?
benben325
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:172 积分:1571 威望:0 精华:0 注册:2021/8/9 16:05:00
  发帖心情 Post By:2023/2/16 17:10:00 [显示全部帖子]

Dim doc As New PrintDoc
doc.PageSetting.Landscape = True
Doc.PageSetting.Width = 75
Doc.PageSetting.Height = 45
Doc.PageSetting.LeftMargin = 0
Doc.PageSetting.RightMargin = 0
Doc.PageSetting.TopMargin = 5
Doc.PageSetting.BottomMargin = 0

Dim ra As prt.RenderArea
Dim ra1 As prt.RenderArea
Dim ra2 As prt.RenderArea
Dim rg As New prt.RenderGraphics
Dim Bar As New BarCodeBuilder
Dim rs As prt.RenderText

For Each dr As DataRow In dt.DataRows
    ra = New prt.RenderArea
    ra.Stacking = prt.StackingRulesEnum.BlockLeftToRight
    
    rg = New prt.RenderGraphics
    Bar = New BarCodeBuilder
    Bar.Symbology = Barpro.Symbology.QRCode
    bar.Code = "kwid_" & dr("kwid")
    '    Bar.QRCodeModuleSize = 0.5
    rg = New prt.RenderGraphics
    bar.DrawOnCanvas(rg.Graphics, 0, 0, 1)
    
    ra.Children.Add(rg)
    
    ra1 = New prt.RenderArea
    ra1.Stacking = prt.StackingRulesEnum.BlockTopToBottom
    
    rs = New prt.RenderText
    rs.Text = dr("kwName")
    rs.Style.F
    rs.Style.F
    rs.Style.FontBold = True
    rs.Style.FontItalic = False
    rs.Style.FontUnderline = False
    rs.Style.TextAlignHorz = prt.AlignHorzEnum.left
    ra1.Children.Add(rs)
    
    rs = New prt.RenderText
    rs.Text = "仓库:" & dr("varGxNames")
    rs.Style.F
    rs.Style.F
    rs.Style.FontBold = False
    rs.Style.FontItalic = False
    rs.Style.FontUnderline = False
    ra1.Children.Add(rs)
    
    rs = New prt.RenderText
    Dim cc As String = ""
    If dr("length") > 0 Then
        cc = dr("length") & "M"
    End If
    If dr("width") > 0 Then
        If cc > "" Then
            cc = cc & " x "
        End If
        cc = cc & dr("width") & "M"
    End If
    If dr("high") > 0 Then
        If cc > "" Then
            cc = cc & " x "
        End If
        cc = cc & dr("high") & "M" 
    End If 
    rs.Text = "尺寸:" & cc
    rs.Style.F
    rs.Style.F
    rs.Style.FontBold = False
    rs.Style.FontItalic = False
    rs.Style.FontUnderline = False
    ra1.Children.Add(rs)
    
    rs = New prt.RenderText
    Dim tj As String = "体积:"
    If dr("volume") > 0 Then
        tj = tj & dr("volume") & "立方"
    End If 
    rs.Text = tj
    rs.Style.F
    rs.Style.F
    rs.Style.FontBold = False
    rs.Style.FontItalic = False
    rs.Style.FontUnderline = False
    'rs.Style.TextAlignHorz = prt.AlignHorzEnum.left
    ra1.Children.Add(rs)
    
    rs = New prt.RenderText
    If dr("weight") > 0 Then
        rs.Text = "承重:" & dr("weight") & "kg"
    Else
        rs.Text = "承重:"
    End If 
    
    rs.Style.F
    rs.Style.F
    rs.Style.FontBold = False
    rs.Style.FontItalic = False
    rs.Style.FontUnderline = False
    'rs.Style.TextAlignHorz = prt.AlignHorzEnum.left
    ra1.Children.Add(rs)
    
    rs = New prt.RenderText
    If dr("liftHigh") > 0 Then
        rs.Text = "离地:" & dr("liftHigh") & "M"
    Else
        rs.Text = "离地:"
    End If 
    
    rs.Style.F
    rs.Style.F
    rs.Style.FontBold = False
    rs.Style.FontItalic = False
    rs.Style.FontUnderline = False
    'rs.Style.TextAlignHorz = prt.AlignHorzEnum.left
    ra1.Children.Add(rs)
    
    ra.Children.Add(ra1)
    doc.Body.Children.Add(ra)
    
    rs = New prt.RenderText
    rs.Text = "二维码时间:" & Format(Date.Now, "g")
    rs.Style.Spacing.top = 3
    rs.Style.Spacing.left = 20
    rs.Style.TextAlignHorz = prt.AlignHorzEnum.left
    rs.Style.F
    rs.Style.F
    rs.Style.FontBold = False
    rs.Style.FontItalic = False
    rs.Style.FontUnderline = False
    doc.Body.Children.Add(rs)
Next
e.WriteReportAsPDF(doc)

 回到顶部