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


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

主题:[求助]条码打印机使用求助

帅哥哟,离线,有人找我吗?
狐狸爸爸
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47448 积分:251048 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2015/4/14 15:04:00 [只看该作者]

将也边距设置小一点,这么小的自定义尺寸,去掉页边距,没有内容区域了
[此贴子已经被作者于2015/4/14 15:04:04编辑过]

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


加好友 发短信
等级:管理员 帖子:47448 积分:251048 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2015/4/14 15:06:00 [只看该作者]

例如设置为0,就可以正常显示了,当然实际打印的时候,你要考虑打印机的可打印范围:

Dim doc As New PrintDoc() '定义一个报表
Doc.PageSetting.Width = 106
Doc.PageSetting.Height = 30
Doc.PageSetting.LeftMargin = 0 '设置左边距
Doc.PageSetting.RightMargin = 0 '设置右边距
Doc.PageSetting.TopMargin = 0 '设置上边距
Doc.PageSetting.BottomMargin = 0 '设置下边距
Dim ra As New prt.RenderArea '定义一个容器
Dim rt As prt.RenderText '定义一个文本对象
ra.Stacking = prt.StackingRulesEnum.InlineLeftToRight '设置容器中对象的排列方式
For i As Integer = 0 To 1
    rt = New prt.RenderText() '创建文本对象
    rt.Text = "Hello Foxtable " & i '设置文本对象的内容
    rt.Width = 50 '宽度为35毫米
    rt.Height = 30 '高度为15毫米
    rt.Style.Spacing.All = 3 '设置各个方向的间隔
    rt.Style.Borders.All = New prt.Linedef(1, Color.Red) '设置边框
    rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
    rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
    ra.Children.Add(rt) '将文本对象加入到容器ra中
Next
doc.Body.Children.Add(ra) '将容器ra加入到报表
doc.Preview() '预览
[此贴子已经被作者于2015/4/14 15:15:17编辑过]

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


加好友 发短信
等级:三尾狐 帖子:713 积分:5196 威望:0 精华:0 注册:2012/4/13 13:10:00
  发帖心情 Post By:2015/4/14 15:07:00 [只看该作者]

以下是引用狐狸爸爸在2015/4/14 15:04:00的发言:
将也边距设置小一点,这么小的自定义尺寸,去掉页边距,没有内容区域了
[此贴子已经被作者于2015/4/14 15:04:04编辑过]

 

 

Dim doc As New PrintDoc() '定义一个报表
Doc.PageSetting.Width = 106
Doc.PageSetting.Height = 30
Dim ra As New prt.RenderArea '定义一个容器
Dim rt As prt.RenderText '定义一个文本对象
ra.Stacking = prt.StackingRulesEnum.InlineLeftToRight '设置容器中对象的排列方式
For i As Integer = 0 To 1
    rt = New prt.RenderText() '创建文本对象
    rt.Text = "Hello Foxtable " & i '设置文本对象的内容
    rt.Width = 50 '宽度为35毫米
    rt.Height = 30 '高度为15毫米
    rt.Style.Spacing.All = 3 '设置各个方向的间隔
    rt.Style.Borders.All = New prt.Linedef(1, Color.Red) '设置边框
    rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
    rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
    ra.Children.Add(rt) '将文本对象加入到容器ra中
Next
doc.Body.Children.Add(ra) '将容器ra加入到报表
doc.Preview() '预览

 

 

狐爸我找不出这个问题出在哪里?

纸张大小是 106 * 30

一行两列显示,50*30一个 共两个,3毫米为边距,我感觉我设置的没错啊


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


加好友 发短信
等级:管理员 帖子:47448 积分:251048 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2015/4/14 15:11:00 [只看该作者]

我说的是页边距

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


加好友 发短信
等级:三尾狐 帖子:713 积分:5196 威望:0 精华:0 注册:2012/4/13 13:10:00
  发帖心情 Post By:2015/4/14 15:18:00 [只看该作者]

以下是引用狐狸爸爸在2015/4/14 15:11:00的发言:
我说的是页边距

 

Dim doc As New PrintDoc() '定义一个报表
Doc.PageSetting.Width = 106
Doc.PageSetting.Height = 30
Doc.PageSetting.LeftMargin = 3 '设置左边距
Doc.PageSetting.RightMargin = 3 '设置右边距
Doc.PageSetting.TopMargin = 0 '设置上边距
Doc.PageSetting.BottomMargin = 0 '设置下边距
Dim ra As New prt.RenderArea '定义一个容器
Dim rt As prt.RenderText '定义一个文本对象
ra.Stacking = prt.StackingRulesEnum.InlineLeftToRight '设置容器中对象的排列方式
For i As Integer = 0 To 1
    rt = New prt.RenderText() '创建文本对象
    rt.Text = "Hello Foxtable " & i '设置文本对象的内容
    rt.Width = 50 '宽度为35毫米
    rt.Height = 30 '高度为15毫米
    rt.Style.Spacing.All = 3 '设置各个方向的间隔
    rt.Style.Borders.All = New prt.Linedef(1, Color.Red) '设置边框
    rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
    rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
    ra.Children.Add(rt) '将文本对象加入到容器ra中
Next
doc.Body.Children.Add(ra) '将容器ra加入到报表
doc.Preview() '预览

 

狐爸,显示问题是解决了,但是不知道为何,打印出来和显示出来实际差距太大……?

如图 是怎么回事

 


图片点击可在新窗口打开查看此主题相关图片如下:44f153175a387002b2281b0c5118e97f.png
图片点击可在新窗口打开查看

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


加好友 发短信
等级:管理员 帖子:47448 积分:251048 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2015/4/14 15:21:00 [只看该作者]

打印机是有有效打印区域的
1、调整进纸位置
2、不要预览,直接打印
3、禁止自动宣传:
http://www.foxtable.com/help/topics/1589.htm


Dim doc As New PrintDoc() '定义一个报表
Doc.PageSetting.Width = 106
Doc.PageSetting.Height = 30
Doc.PageSetting.LeftMargin = 0 '设置左边距
Doc.PageSetting.RightMargin = 0 '设置右边距
Doc.PageSetting.TopMargin = 0 '设置上边距
Doc.PageSetting.BottomMargin = 0 '设置下边距
Doc.AutoRotate = False '禁止自动旋转
Dim ra As New prt.RenderArea '定义一个容器
Dim rt As prt.RenderText '定义一个文本对象
ra.Stacking = prt.StackingRulesEnum.InlineLeftToRight '设置容器中对象的排列方式
For i As Integer = 0 To 1
    rt = New prt.RenderText() '创建文本对象
    rt.Text = "Hello Foxtable " & i '设置文本对象的内容
    rt.Width = 50 '宽度为35毫米
    rt.Height = 30 '高度为15毫米
    rt.Style.Spacing.All = 3 '设置各个方向的间隔
    rt.Style.Borders.All = New prt.Linedef(1, Color.Red) '设置边框
    rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
    rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
    ra.Children.Add(rt) '将文本对象加入到容器ra中
Next
doc.Body.Children.Add(ra) '将容器ra加入到报表
doc.pring() '直接打印
[此贴子已经被作者于2015/4/14 15:22:20编辑过]

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


加好友 发短信
等级:三尾狐 帖子:713 积分:5196 威望:0 精华:0 注册:2012/4/13 13:10:00
  发帖心情 Post By:2015/4/14 16:15:00 [只看该作者]

以下是引用狐狸爸爸在2015/4/14 15:21:00的发言:
打印机是有有效打印区域的
1、调整进纸位置
2、不要预览,直接打印
3、禁止自动宣传:
http://www.foxtable.com/help/topics/1589.htm


Dim doc As New PrintDoc() '定义一个报表
Doc.PageSetting.Width = 106
Doc.PageSetting.Height = 30
Doc.PageSetting.LeftMargin = 0 '设置左边距
Doc.PageSetting.RightMargin = 0 '设置右边距
Doc.PageSetting.TopMargin = 0 '设置上边距
Doc.PageSetting.BottomMargin = 0 '设置下边距
Doc.AutoRotate = False '禁止自动旋转
Dim ra As New prt.RenderArea '定义一个容器
Dim rt As prt.RenderText '定义一个文本对象
ra.Stacking = prt.StackingRulesEnum.InlineLeftToRight '设置容器中对象的排列方式
For i As Integer = 0 To 1
    rt = New prt.RenderText() '创建文本对象
    rt.Text = "Hello Foxtable " & i '设置文本对象的内容
    rt.Width = 50 '宽度为35毫米
    rt.Height = 30 '高度为15毫米
    rt.Style.Spacing.All = 3 '设置各个方向的间隔
    rt.Style.Borders.All = New prt.Linedef(1, Color.Red) '设置边框
    rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
    rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
    ra.Children.Add(rt) '将文本对象加入到容器ra中
Next
doc.Body.Children.Add(ra) '将容器ra加入到报表
doc.pring() '直接打印
[此贴子已经被作者于2015/4/14 15:22:20编辑过]

 

感谢狐爸,我现在能打印了,但是还有个问题,打印出来的条码和其他内容都很模糊是怎么回事呢?

 


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


加好友 发短信
等级:管理员 帖子:47448 积分:251048 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2015/4/14 16:21:00 [只看该作者]

换个方式打印条码:

http://www.foxtable.com/help/topics/2093.htm

 


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


加好友 发短信
等级:三尾狐 帖子:713 积分:5196 威望:0 精华:0 注册:2012/4/13 13:10:00
  发帖心情 Post By:2015/4/14 16:37:00 [只看该作者]

以下是引用狐狸爸爸在2015/4/14 16:21:00的发言:

换个方式打印条码:

http://www.foxtable.com/help/topics/2093.htm

 

 

 

Dim doc As New PrintDoc
Dim Bar As New BarCodeBuilder
Dim ra As New prt.RenderArea '定义一个容器
Dim img As prt.RenderImage
doc.PageSetting.Width = 106
doc.PageSetting.Height = 30
Doc.PageSetting.LeftMargin = 3 '设置左边距
Doc.PageSetting.RightMargin = 0 '设置右边距
Doc.PageSetting.TopMargin = 0 '设置上边距
Doc.PageSetting.BottomMargin = 0 '设置下边距
Doc.AutoRotate = False '禁止自动旋转
Bar.Symbology = Barpro.Symbology.Code93
Bar.BarHeight = 9.08
Bar.QuietZoneWidth = 3
Bar.AddCheckSum = False
Bar.BearerBarWidth = 0.27
Bar.DisplayChecksum = False
Bar.BarWidth = 0.3
Bar.Font = New Font("黑体",10.5)
Bar.TextFont = New Font("黑体",10.5)
Bar.TextAlignment = Barpro.Alignment.AboveLeft
ra.Stacking = prt.StackingRulesEnum.InlineLeftToRight
Dim t As Table = Tables(e.Form.Name & "_Table1")
Dim rs As List(of Row) = t.GetCheckedRows
For Each r As Row In rs
    Bar.Code = r("资产编号")
    Bar.Text = "购置日期:" & r("购置时间")
    img = new prt.RenderImage
    img.Width = 50 '宽度为35毫米
    img.Height = 30 '高度为15毫米
    img.Style.Spacing.Left = 3
    img.Style.Spacing.Right = 1
    img.Style.Spacing.Top = 2
    img.Style.Spacing.Bottom = 3
    img.Style.Borders.All = New prt.Linedef(1, Color.black) '设置边框
    img.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
    img.Style.TextAlignVert = prt.AlignVertEnum.Center
    img.Image = bar.GetImage
    ra.children.add(img)
Next
Doc.Body.Children.Add(ra)
Doc.PrinterName = "Argox CP-2140 PPLB"
Doc.Print()

 

 

我目前这个需求能直接改过去吗?

这条码整了一下午了……


 回到顶部
总数 19 上一页 1 2