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


  共有1362人关注过本帖平板打印复制链接

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

帅哥哟,离线,有人找我吗?
瑞峰
  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

 回到顶部