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 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料