POS的收据打印 [英] Receipt Printing for POS
本文介绍了POS的收据打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为我的商店创建一个计算机系统。
我想用我的POS打印收据打印机。
我使用下面的代码,它工作正常。
但我想改变我的公司名称字体大小ABC SHOP
怎么做。
Hi,
I''m creating a computer system to my shop.
I want to print a receipt using my POS Printer.
I used the following code and it works fine.
But I want to change the font size for my Company Name "ABC SHOP"
How to do it.
<pre lang="text">
Public Sub PrintReceipt()
''Start Print Receipt
Dim fh As IntPtr
Dim SW As IO.StreamWriter
Dim FS As IO.FileStream
fh = Win32API.CreateFile("LPT1:", Win32API.GENERIC_WRITE, 0, 0, Win32API.CREATE_ALWAYS, 0, 0)
''This one works fine
''fh = Win32API.CreateFile("C:\test.txt", Win32API.GENERIC_WRITE, 0, 0, Win32API.CREATE_ALWAYS, 0, 0)
Dim sfh As New Microsoft.Win32.SafeHandles.SafeFileHandle(fh, True)
FS = New IO.FileStream(sfh, IO.FileAccess.ReadWrite)
FS.Flush()
SW = New IO.StreamWriter(FS)
SW.WriteLine("ABC Shop")
SW.WriteLine("Kandy")
SW.WriteLine("045-2256398")
SW.WriteLine("")
SW.WriteLine(lblDate.Text & " " & CurrentUsername & " " & "Bill No" & lblBillNo.Text)
SW.WriteLine("--------------------|--------------------")
Dim Count As Integer
While (Count < dtSales.Rows.Count)
SW.WriteLine(dtSales.Rows(Count).ItemArray(1).ToString)
SW.WriteLine(dtSales.Rows(Count).ItemArray(0).ToString & " " & dtSales.Rows(Count).ItemArray(2).ToString & " " & dtSales.Rows(Count).ItemArray(4).ToString & " " & dtSales.Rows(Count).ItemArray(5).ToString)
Count = Count + 1
End While
SW.WriteLine("")
SW.WriteLine("----------------------------")
SW.WriteLine("")
SW.WriteLine("Thank You")
FS.Flush()
SW.Close()
FS.Close()
sfh.Close()
''End Print Receipt
End Sub
推荐答案
此问题曾被问过一次 - 设置打印机字体大小点阵式打印机 [ ^ ]。一些答案可能会帮助你。
这些链接可能会帮助你 -
http://www.andreavb.com/forum/viewtopic_1963.html [ ^ ]
http://www.c-sharpcorner.com/forums/thread/146204/how-to-change -the-fonts-size-and-style-in-dos-mode-printing.aspx [ ^ ]
This question was asked once before - Setting Printer Font size of Dot-Matrix Printer[^]. Some answers may help you out.
These links might help you out -
http://www.andreavb.com/forum/viewtopic_1963.html[^]
http://www.c-sharpcorner.com/forums/thread/146204/how-to-change-the-fonts-size-and-style-in-dos-mode-printing.aspx[^]
这篇关于POS的收据打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文