Member Avatar for firstbizsoft

Hi all,
Working in a Pos System and using this code for print all product from the list. The code wrk fine the only prb is:
The text begin printing from the middle of paper and not from the left side. Where is the prb?
This is the code:

Private Sub cmdPrint_Click()
Dim WhatDay$, Count%
Dim Tab1%, Tab2%, StoreCurrY%

If frmPOS.List1.ListCount = 0 Then
MsgBox "No has selectado ningun producto", , gStanCap
Exit Sub
End If

Printer.EndDoc
Tab1 = 0
Tab2 = 0
With Printer

.Font = "Courrier New"
.FontSize = 12
.FontBold = True
.FontUnderline = True
.FontSize = 12
.FontUnderline = False

Printer.Print
Printer.Print

.CurrentX = .CurrentX + 1
.FontBold = False
Printer.Print

Do
.CurrentX = Tab1
StoreCurrY = .CurrentY
Printer.Print frmPOS.List1.List(Count)
If Count + 1 = frmPOS.List1.ListCount Then .FontUnderline = True
.CurrentX = Tab2
.CurrentY = StoreCurrY
Printer.Print
Count = Count + 1
Loop While Count < frmPOS.List1.ListCount

.FontUnderline = False
.FontBold = True

.CurrentX = Tab2
.FontBold = True
.FontSize = 14
.CurrentX = (.Width - .TextWidth(" TOTAL:- " & frmPOS.txtTotal)) / 2
Printer.Print "TOTAL:- " & frmPOS.txtTotal
Printer.Print

.CurrentX = Tab1
.FontBold = True
.FontSize = 14
.CurrentX = (.Width - .TextWidth(" GRACIAS POR SU VISITA ")) / 2
Printer.Print " GRACIAS POR SU VISITA "

Printer.EndDoc

End With

End Sub

I`m using a epson tm-u220d and the paper size is 76x292 mm

Tks in advance
Costel

Hi Cos,

Can you try populating the contents to a HTML File instead of issuing a direct print? By this way you can open the HTML file and use print preview to see how it looks.


Regards
Marikanna

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.