:idea:I'm a bit stuck
I wrote a printing part.
But cant find how to preform a pagefeed

Private Sub PrintBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintBTN.Click
        copieen = 1
        PrintDocument1.PrinterSettings.Copies = copieen
        PrintDocument1.Print()
end Sub
 Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
        data = "this is a test"
        Dim xx = 2
        Dim y = 0
        For x = 1 To 40
            If Len(machin(xx)) > 0 Then
                e.Graphics.DrawString(machin(xx), New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 0, y)
                y = y + 14
                For u = 1 To 10
                    e.Graphics.DrawString(data, New Font("Arial", 10), Brushes.Black, 10, y)
                    y = y + 14
                Next u
                y = y + 14
                If y = 1008 Then
                    REM Here i need to give the printer a pagefeed and start on a new page
                    y = 0
                End If
            End If
            xx = xx + 16
        Next x
End Sub

Can someone Plzzzzz help me

Recommended Answers

All 2 Replies

Why on earth would you want to write your own printer code? I have done it and I promise you don't want to!

Take a look here:
http://stackoverflow.com/questions/246233/dot-matrix-printing-in-c

As far as I know you can't guarantee that control characters and fonts a printer has installed or will recognize. I used the technical manuals for each type of printer I had to identify control characters for.

Why on earth would you want to write your own printer code? I have done it and I promise you don't want to!

This code is only to print the right data
I was only expecting a page feed command in the printdocument class

Now it prints till the end of the page and the rest is lost

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.