简体   繁体   中英

How to print from web page without showing print dialog

I need to implement Web based Point of Sales software where receipt printing will be done often and showing print dialogue every time would be annoying. So I want to get rid of the print dialogue. How it could be achieved using JavaScript?

I have searched a lot on internet and unable to find the proper solution. It has to be supported on all the browsers (IE, FireFox, Chrome).

Short answer ... You can't ....

Little longer answer ... You can't and probably never will be able to - its just to restrictive to force a user to print to a specific printer with specific settings

You can use a workaround - this one is not nice.

If you can control the end computer, you can put a simple AutoIt or Autohotkey script on it. The script can 1. check if your page is running 2. always apply the standard printer if so.

We have done this for a terminal which shouldn't contain other software then ours. Such things are not nice however if its an unmanaged pc, sooner or later on such devices you will have the problem that someone wants to print something on another printer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM