Reputation: 21
i have the following code to print the page, i want to add custom page size how do i do that?
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
Upvotes: 0
Views: 12966
Reputation: 606
You can set the paper size using DefaultPageSettings.PaperSize properties of document Example:
Dim xCustomSize As New PaperSize("Legal", 850, 1400)
Me.DefaultPageSettings.PaperSize = xCustomSize
Fine more information here
Upvotes: 1