Foxtable(狐表)用户栏目专家坐堂 → [求助] 标签打印 -设置页面,边距无效果


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

主题:[求助] 标签打印 -设置页面,边距无效果

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


加好友 发短信
等级:童狐 帖子:205 积分:2097 威望:0 精华:0 注册:2018/10/8 13:32:00
[求助] 标签打印 -设置页面,边距无效果  发帖心情 Post By:2023/7/22 16:19:00 [只看该作者]

代码自定义了 页面尺寸,也设置了边距
但是每个电脑,第一次使用时,都要在控制面板中的打印机设置里,新建纸张尺寸和设置边距,以及是否横向打印。
相当于,FT制作的软件里的设置是无效的。

有没有解决的办法。

Dim frm As WinForm.Form = args(0)

Dim PrinterName As String = CType(frm.Controls("cbx_printlist"), WinForm.ComboBox).Text
Dim page_width As Single = CType(frm.Controls("page_width"), WinForm.NumericComboBox).Value
Dim page_height As Single = CType(frm.Controls("page_height"), WinForm.NumericComboBox).Value
Dim BaseLeft As Single = CType(frm.Controls("b_left"), WinForm.NumericComboBox).Value
Dim BaseRight As Single = CType(frm.Controls("b_right"), WinForm.NumericComboBox).Value
Dim BaseTop As Single = CType(frm.Controls("b_top"), WinForm.NumericComboBox).Value
Dim BaseBottom As Single = CType(frm.Controls("b_bottom"), WinForm.NumericComboBox).Value
'Dim LeftMargin As Single = CType(frm.Controls("m_left"), WinForm.NumericComboBox).Value
'Dim RightMargin As Single = CType(frm.Controls("m_right"), WinForm.NumericComboBox).Value
'Dim TopMargin As Single = CType(frm.Controls("m_top"), WinForm.NumericComboBox).Value
'Dim BottomMargin As Single = CType(frm.Controls("m_bottom"), WinForm.NumericComboBox).Value
Dim Landscape As Boolean = CType(frm.Controls("rdo_Horizontal"), WinForm.RadioButton).Checked

Dim doc As New PrintDoc
doc.PrinterName = PrinterName
doc.AutoRotate = False
With doc.PageSetting
    .Width = page_width + BaseLeft + BaseRight
    .Height = page_height + BaseTop + BaseBottom
    .LeftMargin = BaseLeft
    .RightMargin = BaseRight
    .TopMargin = BaseTop
    .BottomMargin = BaseBottom
    .Landscape = Landscape
End With

Return doc

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106688 积分:542629 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/7/22 17:03:00 [只看该作者]

这个是必须要到控制面板里设置的

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


加好友 发短信
等级:童狐 帖子:205 积分:2097 威望:0 精华:0 注册:2018/10/8 13:32:00
  发帖心情 Post By:2023/7/24 11:35:00 [只看该作者]

是不是 打印机设置中, 必须与我们FT软件里的设置 一模一样。
其实边距这些,均只要在打印机里设置就行,

FT软件里只要 规定  页面大小
[此贴子已经被作者于2023/7/24 11:35:53编辑过]

 回到顶部
帅哥,在线噢!
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106688 积分:542629 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/7/24 12:01:00 [只看该作者]

一般打印机设置里指定页面大小和打印方向即可。边距可以在代码里动态设置

 回到顶部