直接从浏览器打印,没有打印弹出窗口 [英] Print directly from browser without print popup window

查看:154
本文介绍了直接从浏览器打印,没有打印弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如主题中所说,我必须为基于 Web 的应用程序创建一个功能,该功能将允许用户直接发送打印而不提示任何对话框,只需进行打印即可,即单击并打印,非常简单!但不适合我:(.

As it said in the subject I've to create a feature for a web-based application that will allow users to send print directly without prompting any dialog boxe just make the print i.e click and print, simple! but not for me :(.

请建议最好的选择以及我应该如何写(技术).

Please, suggest what would be the best option and how should I write it up (technology).

请提出建议!

谢谢.

打印应该在用户的默认打印机上发送.

The print should be send on the user's default printer.

推荐答案

我找不到其他解决方案浏览器.当我发布这个问题时,IE 在更高的优先级,很高兴我找到了一个.如果你有解决办法对于其他浏览器(firefox、safari、opera),请在此处分享.谢谢.

I couldn't find solution for other browsers. When I posted this question, IE was on the higher priority and gladly I found one for it. If you have a solution for other browsers (firefox, safari, opera) please do share here. Thanks.

VBSCRIPT 比在 VB6 或 C#/VB.NET 上创建 ActiveX 方便得多:

VBSCRIPT is much more convenient than creating an ActiveX on VB6 or C#/VB.NET:

<script language='VBScript'>
Sub Print()
       OLECMDID_PRINT = 6
       OLECMDEXECOPT_DONTPROMPTUSER = 2
       OLECMDEXECOPT_PROMPTUSER = 1
       call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,1)
End Sub
document.write "<object ID='WB' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object>"
</script>

现在,调用:

<a href="javascript:window.print();">Print</a>

将发送打印而不弹出打印窗口.

will send print without popup print window.

这篇关于直接从浏览器打印,没有打印弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆