使用php(javascript)在没有Windows打印对话框的情况下在本地打印页面 [英] Print a page on local using php (javascript) without Windows print dialog box

查看:107
本文介绍了使用php(javascript)在没有Windows打印对话框的情况下在本地打印页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为商店开发内联网。我需要通过点击php页面上的提交按钮来打印收据。我不想看到Windows打印对话框。

I am developping an intranet for a shop. I need to print a receipt by clicking a submit button on php page. I do not want to see Windows print dialog box.

我该怎么做。我需要一些建议

how can I do this. I need some advise

我将使用Windows XP,我可以完全控制该应用程序将运行的系统,可以安装任何应用程序/插件/漏洞利用程序等用于帮助删除打印对话框。

I will use Windows XP, I have full control of the system which this application will be running, Any application/plugin/exploits etc can be installed or used to help with removing the print dialog box.

问候

推荐答案

我使用PHP编写的车间订单系统执行此操作,并通过jquery使用打印对话框。
你可以使用about:config页面绕过firefox打印对话框。

I do this with my shop order system written in PHP and it uses a print dialog via jquery. you can bypass the firefox print dialog by using the about:config page.


  • 打开firefox并输入 about:在地址栏中输入并按Enter键(您需要点击显示您知道自己在做什么的按钮)

  • 输入 print.always_print_silent 在顶部的过滤框中
    如果您已经有一个条目并且它被设置为false只需右键单击它并选择切换将其设置为true。
    如果那里没有条目,那么请继续...
    • 右键单击屏幕并选择New-> boolean

    • enter <当询问并输入
    • 将布尔值设置为 true 并输入
    • $ b时,选择strong> print.always_print_silent 作为首选项名称$ b
    • Open firefox and put about:config in the address bar and press enter (you will need to click the button that shows to say you know what you're doing)
    • Type print.always_print_silent in the filter box at the top If you have an entry already there and it is set to false just right click it and choose 'toggle' to set it to true. If there is no entry there already then follow on...
      • right click the screen and choose New->boolean
      • enter print.always_print_silent as the preference name when asked and press enter
      • set boolean value to true and press enter

      就是这样,打印时你将不再看到对话框。但要注意,它会尝试打印到打开对话框时使用的最后一台打印机。如果您需要更改它,则需要按照上述步骤切换print.always_print_silent的值。

      That's it, you will no longer see the dialog box when you print. Beware though, it will try to print to the last printer you used when you had the dialog box open. If you ever need to change it then you will need to toggle the value for print.always_print_silent by following the above steps.

      这篇关于使用php(javascript)在没有Windows打印对话框的情况下在本地打印页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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