简体   繁体   English

通过javascript选择特定的打印机

[英]Selecting specific printer by javascript

I have two printer connected to my computer. 我有两台打印机连接到我的计算机。 Can I select a specific printer by javascript code. 我可以通过javascript代码选择特定的打印机。

Print options cannot be bypassed. 无法绕过打印选项。 Default printer is determined on the visitors OS. 默认打印机是在访客OS上确定的。 There is nothing you can do about it with plain old JavaScript. 使用普通的旧JavaScript您无能为力。 It might be possible with Flash or Java, but it would potentially cause loss of trust from your visitors. Flash或Java可能是可行的,但可能会导致访问者失去信任。

You can't, the browser won't allow it. 您不能,浏览器不允许。 This is in place to safeguard the printer from malicious printing by websites. 这样做是为了保护打印机免受网站的恶意打印。

If you have a closed environment (like an intranet) you could print on the server side to a printer connected to a server. 如果您具有封闭的环境(例如Intranet),则可以在服务器端使用连接到服务器的打印机进行打印。 The exact details would depend on your server setup and you'd best discuss that with your local system administrator. 具体细节取决于您的服务器设置,您最好与本地系统管理员讨论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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