If you want to skip the view and confirmation screens, you can not cross-browser. This is from the browser implementation. Maybe is possible with IE if you set up a printer by default - although I do not know IE in depth and can not guarantee that it is even possible - but I guarantee that in Chrome it does not give because it goes necessarily show at least the dialog where you choose whether you want to send it to a device or save it as a document.
Editing: Chrome has a kiosk mode, see Vitor Pinho's answer . However, the way kosqueque has its problems there. This solution has stopped working from one version to another before, so if you want to use it, you may need to freeze the browser version in your POS.
Javascript itself is built with this in mind. To request an impression with JS, you call the print
method of the window
object. So:
window.print();
In very basic terms ... This is a way for you to say to the browser: "pretend that the user pressed CTRL + P in the window where this script runs!" the print code you run is the browser code, not your code.
Otherwise, it's good practice to have a print style sheet (CSS), which is distinct from the "main" sheet of the site. This print style sheet usually removes background colors and images, headers, footers, and so on. to leave the content more suitable for printing. When printing, do not call window.print();
in the content window: open a new tab with the E content sheet, and on that new tab call window.print();
. Good luck!