Click here to Skip to main content
Rate this: bad
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
        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.
Posted 14-Feb-13 23:32pm
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
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.
Espen Harlinn at 15-Feb-13 9:55am

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

  Print Answers RSS
0 mhegazy94 460
1 Sergey Alexandrovich Kryukov 405
2 Kornfeld Eliyahu Peter 285
3 Gihan Liyanage 167
4 Sibeesh KV 150
0 Sergey Alexandrovich Kryukov 6,805
1 OriginalGriff 6,696
2 CPallini 5,350
3 George Jonsson 3,609
4 Gihan Liyanage 2,792

Advertise | Privacy | Mobile
Web01 | 2.8.140922.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