dtkwt62022 2018-03-09 07:37
浏览 109

直接打印,无窗口提示,份数,PHP Javascript / Jquery

I have an intranet website system on php. When Print Tickets, I do not wish to receive the myWindow.print(); prompt window and wish to assigned it number of copies to print in php and javascripst/jquery code.

My current sample code is as such

function PrintTicket()
{
    myWindow=window.open('','','width=200,height=100');
    myWindow.document.write("<p>Ticket No: '12345'</p>");
    myWindow.document.close();  
    myWindow.focus();
    myWindow.print(); 
}

Please advise how can I do so as printer EPSON do not take number of copies as parameter.

  • 写回答

1条回答 默认 最新

  • dsvs50005 2018-03-09 10:46
    关注

    This is not possible because the only browser's JavaScript API exposed is the print one which requires user interaction. It's also a security matter, imagine a web page that prints hundreds of pages without user approval. Also, JavaScript can't view printers connected to computer or other devices enumeration for the same security purpouse.

    评论

报告相同问题?

悬赏问题

  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧