0

: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

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Ulukay
0

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.

Edited by sknake: n/a

0

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

Edited by Ulukay: Typo

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.