Click here to Skip to main content
13,249,401 members (30,596 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 15-Feb-13 0:32am
Dave Kreskowiak 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171114.1 | Last Updated 15 Feb 2013
Copyright © CodeProject, 1999-2017
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