简体   繁体   中英

Print a receipt using react JS

I build a restaurant app using React JS and I want to print a receipt when the order got accepted. The restaurant has a wifi printer and I have no idea how should I connect a printer with that website.

There are two ways I know we can do this.

  1. Windows.print() - When added this native trigger, it'll open the regular print dialog box. Which in further you can select you printer and one can take print out.

  2. ReactToPrint - react-to-print - This library also help you to achieve the same results but in abstracted manner and some over-the-top modifications.

Though, if you're wondering that wherever an order is placed but print should be printed then this might not help but I strongly believe that this will help you figure out something.

Some other useful resources:

  1. React Native scan printers when connected to wifi network and get ip address of the printer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM