Private Sub PrintDocument3_PrintPage(sender As Object, e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument3.PrintPage
Dim PrintFont As New Font("Arial", 18)
Dim LineHeight As Single = PrintFont.GetHeight + 2
Dim Horizontal As Single = 100
Dim Vertical As Single = e.MarginBounds.Top
Dim PrintLine As String = "This is a Chapter 4 Testing"
Static pageCount As Integer = 1
e.Graphics.DrawString("Page" & pageCount.ToString(), PrintFont, Brushes.Blue, 600, Vertical)
Vertical += LineHeight * 2
Do
'Assume This Have 40 Copies
e.Graphics.DrawString(PrintLine, PrintFont, Brushes.Blue, Horizontal, Vertical)
Vertical += LineHeight
If Vertical >= e.MarginBounds.Bottom Then
pageCount += 1
e.HasMorePages = True
Else
e.HasMorePages = False
End If
Loop Until e.HasMorePages = False
End Sub
i would like to ask how can i add more page when the e.Graphics.DrawString has reach e.MarginBound.Bottom?
The code above is what i've tried.