我有以下代码来打印页面,我想添加自定义页面大小我该怎么做?
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
PrintDialog1.AllowSomePages = True
PrintDialog1.ShowHelp = True
PrintDialog1.Document = docToPrint
Dim result As DialogResult = PrintDialog1.ShowDialog()
If (result = DialogResult.OK) Then
docToPrint.Print()
End If
End Sub
答案 0 :(得分:1)
您可以使用文档的DefaultPageSettings.PaperSize属性设置纸张大小 例如:
Dim xCustomSize As New PaperSize("Legal", 850, 1400)
Me.DefaultPageSettings.PaperSize = xCustomSize
更多信息here