Microsoft
Software
Hardware
Network
Question : Dot Matrix printing from vb.net
Hi guys,
I need to print a a receipt on EPSON LQ2180 from vb.net.
Receipt is pre printed custom size. 21.7cmx10.1cm
I need to print 10-20 copies together so the spacing is very important.
What is the right way of printing to dot matrix printer.
I tried setting custome page size on printer and using it from crystal report. But the page setting is not working. It skips the whole page after printing one receipt.
Now i am trying to make an text file from vb and then printing it directly to lpt1. will this solve the problem. Is this the right way of doing it. Can i print bold characters, how will i reset the printer and eject the page after final receipt.
This is the code i am using for printing
Try
Dim pd As New PrintDialog()
pd.PrinterSettings = New PrinterSettings()
pd.PrinterSettings.Printer
Name = "Adobe PDF"
Dim fl As String = objApp.appPath & "\print\" & "awbill" & Now.Hour & Now.Minute & Now.Second & ".txt"
Dim TextFile As New StreamWriter(fl)
==========================
==
For i As Integer = 1 To 10
TextFile.WriteLine("")
TextFile.WriteLine("")
TextFile.WriteLine(Space(1
00) & Int(tbAwvalue.Text))
TextFile.WriteLine("")
TextFile.WriteLine(Space(1
00) & "Upto " & Int(tbAwweight.Text) & " Kg")
TextFile.WriteLine("")
TextFile.WriteLine("")
TextFile.WriteLine("")
TextFile.WriteLine("")
TextFile.WriteLine("")
TextFile.WriteLine("")
TextFile.WriteLine("")
TextFile.WriteLine("")
TextFile.WriteLine("")
TextFile.WriteLine("xxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxx")
Next
TextFile.Close()
RawPrinterHelper.SendFileT
oPrinter(p
d.PrinterS
ettings.Pr
interName,
fl)
Catch ex As Exception
MsgBox(ex.Message)
End Try
=======================
Please guide me.
Thanks
Answer : Dot Matrix printing from vb.net
Form Feed (new page) character [FF] AscII code : 12
Reset printer characters [ESC] @ AscII code :27 64
http://www.dragon-it.co.uk
/links/eps
on_printer
_codes.htm
Random Solutions
Excel: Conditional formatting checking for unequal cells in portions of 2 wksts
DBNETLIB][ConnectionOpen(C<wbr />onnect()).<wbr />]Specified<wbr /> SQL server not found. MADNESS
Need Assistance Selecting Web Authoring Tool
How to restrict navteq map only for uk?
Dropdownlist change, does not change textboxes
Error : Cannot open Service Control Manager on remote computer. This operation might require other privileges.
What to monitor with MOSS 2007
outputto naming structure
How to delete a user certicate with a batch file?
MS Access Where to put the code to calculate a field using data from a record selected in a subform