以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]窗口四联打印(24*14)总多一张空白  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=94343)

--  作者:ajie5211
--  发布时间:2016/12/21 15:24:00
--  [求助]窗口四联打印(24*14)总多一张空白
如题,窗口四联打印,纸张是(24*14),代码直接打印,总多出一张空白如何解决?
--  作者:ajie5211
--  发布时间:2016/12/21 15:29:00
--  

e.Form.Page.Width = 220

e.Form.Page.Height = 135

e.Form.Page.LeftMargin = 10 \'设置左边距
e.Form.Page.RightMargin = 10 \'设置右边距
e.Form.Page.TopMargin = 10 \'设置上边距
e.Form.Page.BottomMargin = 10 \'设置下边距
e.Form.Controls("打印时间").text = "打印时间:" & Date.Now
Dim grp As WinForm.GroupBox = e.Form.Controls("GroupBox1")
Dim doc As PrintDoc = e.Form.GernatePrintDoc(grp)
\'doc.AutoRotate = False \'禁止自动旋转打印内容
Doc.PrinterName = DefaultPrinter
doc.Print()
\'*****保存********
Dim bcbt As WinForm.Button = e.Form.Controls("保存")
If bcbt.Visible = True Then
    bcbt.PerformClick()
End If


--  作者:有点色
--  发布时间:2016/12/21 16:13:00
--  

宽高设置调小一点试试

 

e.Form.Page.Width = 220

e.Form.Page.Height = 135


--  作者:ajie5211
--  发布时间:2016/12/21 16:40:00
--  
以下是引用有点色在2016/12/21 16:13:00的发言:

宽高设置调小一点试试

 

e.Form.Page.Width = 220

e.Form.Page.Height = 135

调整小了,还是不行。


--  作者:有点色
--  发布时间:2016/12/21 17:39:00
--  

 是不是你打印的内容超出了纸张的范围了啊?另外做一个小窗口,简单加入内容,看是否也同样会这样。

 

 再有就是,你窗口某些控件,是不是有属性设置 另起一页 成了 true


--  作者:ajie5211
--  发布时间:2016/12/22 9:03:00
--  
以下是引用有点色在2016/12/21 17:39:00的发言:

 是不是你打印的内容超出了纸张的范围了啊?另外做一个小窗口,简单加入内容,看是否也同样会这样。

 

 再有就是,你窗口某些控件,是不是有属性设置 另起一页 成了 true

控件中没有你说的另起一页,窗口整很小了,还是多一页空白。


--  作者:ajie5211
--  发布时间:2016/12/22 9:18:00
--  
EPSON LQ-635K ESC/P 2 Ver 2.0打印机始终错误。不知道什么原因。
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目2.rar


--  作者:有点色
--  发布时间:2016/12/22 9:27:00
--  

 我测试打印,没有问题啊。

 

 你尝试不要设置页面大小。

 

\'e.Form.Page.Width = GetConfigValue("_zldzzkd", 240) \'纸张宽度为100毫米
\'e.Form.Page.Height = GetConfigValue("_zldzzgd", 140) \'纸张高度为120毫米
\'e.Form.Page.LeftMargin = 1 \'设置左边距
\'e.Form.Page.RightMargin = 5 \'设置右边距
\'e.Form.Page.TopMargin = 2 \'设置上边距
\'e.Form.Page.BottomMargin = 10 \'设置下边距
Dim grp As WinForm.GroupBox = e.Form.Controls("GroupBox1")
Dim doc As PrintDoc = e.Form.GernatePrintDoc(grp)
\'doc.AutoRotate = False \'禁止自动旋转打印内容
Doc.PrinterName = GetConfigValue("_zlddyj",DefaultPrinter)
doc.print


--  作者:ajie5211
--  发布时间:2016/12/22 10:44:00
--  
以下是引用有点色在2016/12/22 9:27:00的发言:

 我测试打印,没有问题啊。

 

 你尝试不要设置页面大小。

 

\'e.Form.Page.Width = GetConfigValue("_zldzzkd", 240) \'纸张宽度为100毫米
\'e.Form.Page.Height = GetConfigValue("_zldzzgd", 140) \'纸张高度为120毫米
\'e.Form.Page.LeftMargin = 1 \'设置左边距
\'e.Form.Page.RightMargin = 5 \'设置右边距
\'e.Form.Page.TopMargin = 2 \'设置上边距
\'e.Form.Page.BottomMargin = 10 \'设置下边距
Dim grp As WinForm.GroupBox = e.Form.Controls("GroupBox1")
Dim doc As PrintDoc = e.Form.GernatePrintDoc(grp)
\'doc.AutoRotate = False \'禁止自动旋转打印内容
Doc.PrinterName = GetConfigValue("_zlddyj",DefaultPrinter)
doc.print

怎么都不行,多一张空白纸。晕了。


--  作者:有点色
--  发布时间:2016/12/22 11:01:00
--  
 单独做一个窗口,打印一个label文字,看是否也会是两页。