Hi @Michael Chapman ,
You can set the printer's orientation to landscape or portrait using the PageSettings
property of the PrintDocument
.
You can use the TranslateTransform
and RotateTransform
methods to change the direction of the drawing.
Private WithEvents PrintDocument1 As New PrintDocument
Private WithEvents PrintPreviewDialog1 As New PrintPreviewDialog
Public Sub Printit()
PrintDocument1.DefaultPageSettings.Landscape = True
PrintPreviewDialog1.Document = PrintDocument1
PrintPreviewDialog1.ShowDialog()
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As PrintPageEventArgs) Handles PrintDocument1.PrintPage
Setup_printer(e)
End Sub
Public Sub Setup_printer(ByVal e As PrintPageEventArgs)
e.Graphics.TranslateTransform(0, e.PageBounds.Height)
e.Graphics.RotateTransform(-90)
End Sub
Best Regards.
Jiachen Li
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.