Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hi all
 
I've created a program to make an receipt, problem is that I need it to print on a
thermal continues POS printer. Each receipt is a different length. Any1 has any ideas
on how to do this?
 
The items to print is from a list box. the code for my printing is:
 
    Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
        Dim fnt As New Font("Courier10 BT", 10, FontStyle.Regular, GraphicsUnit.Point)
        Dim ListBoxItem As String = String.Empty
        For Each LBItem As String In lstReciept.Items
            ListBoxItem = ListBoxItem & vbCrLf & LBItem
        Next
        ListBoxItem = ListBoxItem.Substring(vbCrLf.Length)
        e.Graphics.DrawString(ListBoxItem, fnt, Brushes.Black, 0, 0)
        e.HasMorePages = False
    End Sub

 
Can you also help me as to what size to set the list box so that it is same size (width) as
my receipt.
 
Thanks
Posted 14-Feb-13 23:32pm
Comments
Dave Kreskowiak at 15-Feb-13 9:46am
   
Do you have an SDK for this printer?? If not, you're in for quite a bit of work.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can also try reading up on Microsoft POS for .NET[^]. It has classes that make it much easier to print to a POS printer than using the PrintDocument class.
  Permalink  
Comments
Espen Harlinn at 15-Feb-13 9:55am
   
5'ed!

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 717
1 ChauhanAjay 135
2 Maciej Los 130
3 ashok rathod 90
4 ChintanShukla 90
0 Sergey Alexandrovich Kryukov 10,200
1 OriginalGriff 6,987
2 CPallini 5,850
3 George Jonsson 4,015
4 Gihan Liyanage 3,266


Advertise | Privacy | Mobile
Web02 | 2.8.140926.1 | Last Updated 15 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100