Using Microsoft POS .NET, is it possible to "render" the output on a server and just send the bytes to the client for printing?

StackOverflow https://stackoverflow.com/questions/14255855

  •  14-01-2022
  •  | 
  •  

Using Microsoft POS.NET with Epson receipt printing, is it possible to create the receipt for printing on a server (server has POS.NET and Epson drivers installed, but no printer, attached) by writing the bytes that would have go to the printer to a file?

After that we would like to be able to transmit these to a client machine which DOES have the printer installed and all it does is stream the bytes to the printer.

All we've got so far is the Epson sample code running on a dev machine, I can't see any obvious way to do "Print To File" or intercept the bytes.

有帮助吗?

解决方案

Unfortunately for you, OPOS does not offer this functionality natively. The closest it has is "Page Mode", where you set the OPOS receipt or slip printer into a Page Mode state, and then all your print commands are buffered internally by the Service Object. You then issue an OPOS pageModePrint() command to send the entire receipt to the printer at a later time. But OPOS does not offer access to the buffer, and the vendor is free to implement it in any way they want (including not implementing the capability at all.)

To solve your problem, the easiest solution I can think of would be to check your Service Object to see if it supports networked printing. Perhaps the service object is already capable of printing to a network attached printer, or to another computer hosting a printer. The vendor may offer access to the Page Mode buffer via DirectIO commands. Your printer vendor may offer these as additional (paid) features, or they may offer to custom write one for you. If the vendor already offers an Ethernet communication board option for your printer, it's likely they already have everything you need. It can't hurt to ask.

If not, you are certainly free to write your own Service Object to accomplish the task of buffering the data and making it available to your application. It's certainly not impossible to slide a custom Service Object as a "wedge" between the Common Controls and the vendor-provided Service Object, and permit custom control via the DirectIO() method. I once did exactly that to add scanner buffer functionality before, but I've never done it for anything as complex as a printer.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top