此主题相关图片如下:qq图片20181229152505.jpg
此主题相关图片如下:qq图片20181229152501.jpg
此主题相关图片如下:qq图片20181229152440.jpg
Dim doc As New PrintDoc
doc = print.单据打印(窗口名称)
If doc Is Nothing Then
Return
End If
doc.AutoRotate = False
Dim ps As New Printing.PrinterSettings
ps.PrinterName = Vars("打印机")
For Each ps1 In ps.PaperSizes
If ps1.PaperName.Equals(Vars("纸张")) Then
' doc.PageSetting.Width = 235
' doc.PageSetting.Height = 138
doc.Document.DefaultPageSettings.PaperSize = ps1
doc.PageSetting.BottomMargin = Decimal.Parse(Vars("下边距"))
doc.PageSetting.TopMargin = Decimal.Parse(Vars("上边距"))
doc.PageSetting.LeftMargin = Decimal.Parse(Vars("左边距"))
doc.PageSetting.RightMargin = Decimal.Parse(Vars("右边距"))
doc.PageSetting.Landscape = IIf(Vars("纵向") = 0, False, True)
doc.PrinterName = Vars("打印机")
doc.Print()
End If
Next