POS Application Development - Receipt Printing

后端 未结 4 759
小蘑菇
小蘑菇 2020-12-12 23:45

I\'ve been building a POS application for a restaurant/bar.
The design part is done and for the past month I\'ve been coding it.
Everything works fine except now I

4条回答
  •  感动是毒
    2020-12-13 00:11

    POS for .NET is probably the way to go.

    Most receipt printer manufacturers will provide an OPOS service object.

    And as this MSDN article states, POS for .NET is compatible with OPOS v1.8 service objects.

    OPOS / UPOS (on which POS for .NET is based) is IMHO a poorly-designed API (designed by device manufacturers rather than application developers), but it's the best you have today.

    I don't have any specific samples but the basics are the same as OPOS - you need to Open, Claim, Enable a device, then you can call its methods (such as Print). You might try looking at an OPOS sample, for example this PosPrinter1 sample, which will probably be very similar to POS for .NET.

    This blog has some information about setting up POS for .NET that might be helpful.

    UPDATE

    Here's a VB Hello World for an OPOS printer. You first need to create a printer and add it to the registry with the required Logical Device Name = LDN. I believe the Epson ADK includes a utility to add a printer in the registry. This utility can also perform a health check on the printer to check it is installed correctly. Once you've done this, it should be easy enough to adapt the code below to POS for .NET

    OPOSPOSPrinter.Open "MyPrinter"    ' LDN of your printer   
    OPOSPOSPrinter.Claim 500           ' Timeout   
    OPOSPOSPrinter.DeviceEnabled = True  
    
    '- Print   
    OPOSPOSPrinter.PrintNormal 2, "Hello world"  
    
    '- Close the printer   
    If OPOSPOSPrinter.Claimed then   
       OPOSPOSPrinter.Release   
    End If  
    OPOSPOSPrinter.Close  
    

提交回复
热议问题