Hello
I think this is a easy to fix problem, but I have no idea how. I'm using PrintDocument and want to print an image which should be in center of the printed page. How do I code this? This is what I got so far:
VB Code:
Private Sub Print() Dim pd As New Printing.PrintDocument() AddHandler pd.PrintPage, AddressOf PrintPage 'Start printing. pd.Print() End Sub Private Sub PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) e.PageSettings.Margins.Left = 0 e.PageSettings.Margins.Right = 0 e.PageSettings.Margins.Top = 0 e.PageSettings.Margins.Bottom = 0 'Draw the image on the printing surface. Try e.Graphics.DrawImage(capWin, 0, 0, 0, 0) Catch ex As Exception MessageBox.Show("Some message", "Printer Notification Message", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, False) End Try End Sub


Reply With Quote