1

In a web-based ERP , we need to print POS reciept on the client . When I click print on client another web page opens up, and I have to click print again so that it goes into the printer. Then I have to close the window and then go back to data entry webpage page again.

How can I print from the client browser most efficiently? i.e. After the data is saved, I click print and it opens, prints and closes the browser window automatically. How can this be achieved? In offline versions it happens, but when i take it on browser it doesn't occur. Pls help

  1. Front end:- .NET, HTML5, Javascript, Jquery
  2. Backend (Database):- MS SQL
  • Possible duplicate of [HTML / Javascript One Click Print (no dialogs)](https://stackoverflow.com/questions/9213660/html-javascript-one-click-print-no-dialogs) – Ben Jul 11 '17 at 15:06

1 Answers1

0

There is one way to print a page using JavaScript, excluding additional libraries. It uses a method called window.print()

You seemed to suggest that you wanted to remove the prompt that happens with the window.print() method. I don't recommend this behaviour, as most people don't want their printer suddenly spitting out paper, not to mention that this is technically malware. However, assuming you have a legitimate use case for this behaviour, there is a duplicate question with answers already.

HTML / Javascript One Click Print (no dialogs)

Ben
  • 2,200
  • 20
  • 30