I wonder is there any way to print the pos receipt through javascript and c# mvc, the most important condition is cannot redirect page or refresh the current page. I cannot find any reference online, anybody can suggest me? Or javascript totally cannot done something like this? I do not want to use print.js cause it will pop out a page and let user to choose which printer to use.
Asked
Active
Viewed 452 times
0
-
have you tried window.print() method of javascript. It is working as Ctrl+p on a browser – Amit chauhan Oct 10 '18 at 04:46
-
There is such a thing. [EPSON ePOS SDK for JavaScript](http://www.seathost.net/EPSONPrinting/ePOS_SDK_for_JavaScript_um_en_revA.pdf), [STAR Micronics WebPRNT](https://starmicronics.com/pages/WebPRNT) – kunif Oct 10 '18 at 05:03
-
A list of possible solutions: https://stackoverflow.com/a/28783269/3196753 – tresf Dec 10 '22 at 07:37
1 Answers
1
Short Answer: No.
When you want to print something in a browser, well you may use different approaches like window.print()
however no matter which method you do, finally you are just asking the browser to do the print (sending the print command), so it is something that depends on browser and if it insists on showing print options before printing, you can do nothing about it and you can not go beyond what it gives access to you, and what it doesn't.
So this is something related to how the browser functions and its limitations and has nothing to do with javascript or c#.

Ashkan Mobayen Khiabani
- 33,575
- 33
- 102
- 171