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