直接通過您的Pocket PC打印將是一件非常有用的事情,特別是當(dāng)您需要給您的客戶接受時(shí)。IrDA為您提供了該項(xiàng)功能,您可以通過它直接建立其設(shè)備與打印機(jī)的連接操作。Sapphire IrDA Utility允許您在您的程序中附近的打印機(jī)執(zhí)行打印操作。
Printing from your application can be a very useful tool in a situation where you need to give a receipt to your customer direct from your Pocket PC. The ideal solution is to use an IrDA enabled printer with the IrDA port on your device. The Sapphire IrDA Utility allows you to print to such a printer right within your application.
需要培訓(xùn)、定制、外包?
請(qǐng)聯(lián)系我們!:800018081
慧都專業(yè)技術(shù)團(tuán)隊(duì)幫助您提高效率,節(jié)省成本,降低風(fēng)險(xiǎn)!
* 關(guān)于本產(chǎn)品的分類與介紹僅供參考,精準(zhǔn)產(chǎn)品資料以介紹為準(zhǔn),如需購(gòu)買請(qǐng)先行測(cè)試。
通過以下功能,Sapphire IrDA Utility可以方便操作紅外打印機(jī):
- 與 IrDA 所支持的打印機(jī)建立連接
- 在打印機(jī)中打印文本信息
- 在打印機(jī)中添加頁面標(biāo)識(shí)線和換頁打印
- 關(guān)閉與打印機(jī)的連接
實(shí)例代碼該操作是如此簡(jiǎn)單的,您只需在您的程序中聲明相應(yīng)的DLL函數(shù),然后在您需要的地方調(diào)用即可。以下是一個(gè)VB.NET的示范程序,用于演示如何與打印機(jī)建立連接和打印文本字符串內(nèi)容.
Dim iRet As Integer
Dim sLine As String
iRet = prnConnect(SapphireIRDALicence)
If (iRet = 0) Then
' Start printing the text
sLine = "Test print using the SapphireIRDA DLL"
If (prnPrintLine(sLine, sLine.Length)
MsgBox("Failed prnPrintLine")
End If
End If
The Sapphire IrDA Utility makes infra-red printing easy with the following functionality:
- Establish a connection with a IrDA enabled printer
- Print text to the printer
- Print new lines and form feeds to the printer
- Close the connection to the printer
Sample Code
Implementation couldn’t be easier, simply declare the DLL function as a function within your application and call it as though you wrote it yourself. Here’s a sample demo on how to connect to a printer and print a string of text within
VB.NET.
Dim iRet As Integer
Dim sLine As String
iRet = prnConnect(SapphireIRDALicence)
If (iRet = 0) Then
' Start printing the text
sLine = "Test print using the SapphireIRDA DLL"
If (prnPrintLine(sLine, sLine.Length) <> 0) Then
MsgBox("Failed prnPrintLine")
End If
End If