I have a print button in a web application, which on click will generate and print two receipts(Receipt A & Receipt B) at a time. Right now the print is coming to a single printer(Printer X). I want the Receipt A to be print in Printer X & Receipt B to be print in Printer Y without selecting the printer every time. Is there any way to crack this issue
This is not possible - the browser will not allow it as a security feature, to avoid unwanted prints to vulnerable printers.
The browser leaves the choice of the printer entirely to the operating system and what it allows to the user. The Web developer may customize the content to be printed, depending on which button is clicked, but choosing the printer is only done by the user.
The only way to do that is by developing an extension to the browser that will initiate the print to a specific printer.
This is possible by using a commercial solution like Ricoh Print&Share. You just always print to Print&Share and let it do the routing and selection of the printer(s). Depending on the needs this may be configured in different ways, e.g. two profiles using profile recognition. a single profile splitting the input job with two print channels and using page definitions.