Click here to Skip to main content
15,668,923 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
       Dim prndoc As PrintDocument = New PrintDocument
                prndoc.DocumentName = Text
                AddHandler prndoc.PrintPage, AddressOf Me.Paper_PrintBill

    End Sub

Public Sub Paper_PrintBill(ByVal obj As Object, ByVal e As PrintPageEventArgs)
      	 Dim printFont4 As Font = New Font("Verdana", 10)
                  e.Graphics.DrawString("B.No: " & txtreceiptno.Text, printFont4, Brushes.Black, 10, 20)
                    e.Graphics.DrawString(DateTime.Now.ToString("dd/MM/yyyy"), printFont4, Brushes.Black, 10, 50)
    End Sub     

My code is similar to this. when i am printing an invoice the output was very slow Can Any one help Me Please
Updated 15-Sep-18 11:36am
Mehdi Gholam 6-Oct-14 4:59am    
Dotmatrix printer are fast when printing text, what you are sending in the above code is graphics which is really slow on them.
Moses Geo 6-Oct-14 5:08am    
how to print text in dotmatrix printer
Mehdi Gholam 6-Oct-14 5:15am    
Try google, one example is
Moses Geo 6-Oct-14 5:38am    
Sorry I don't Know how to use it while executing that code an console open. Can you help me how can i use it on project

1 solution

Check your "resolution"; you can probably get by with less (e.g. 300 dpi versus 600+).

And ... you should be printing "asynchronously".
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900