Print to default printer without open the printer confirmation dialog box in html using Javascript

吃可爱长大的小学妹 提交于 2020-01-30 13:28:07

问题


In html file print the particular div on clicking the button without open the printer confirmation popup dialog box automatically print that content.


回答1:


This it not practically possible in a way that's supported by all modern browsers. And for good reason.

You don't want random websites to start printing stuff without your intervention.




回答2:


Right Click the google chrome shortcut in the desktop,Select PROPERTIES Then in Target

Add the given code at the end

--user-data-dir=c:\tmp --kiosk-printing

For example:

"C:\Users\alpha\AppData\Local\Google\Chrome\Application\chrome.exe" --user-data-dir=c:\tmp --kiosk-printing.

It's useful for instant billing using the normal window.print option without any popup box interfere.



来源:https://stackoverflow.com/questions/40020826/print-to-default-printer-without-open-the-printer-confirmation-dialog-box-in-htm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!