在Android设备上使用window.print()或替代方法 [英] Using window.print() or alternative on Android devices
问题描述
在Android设备上(我测试过Nexus 5,Nexus 10,Galaxy S4和Galaxy Tab 3),JavaScript中的 window.print()
命令不会执行任何东西。至于我可以告诉它甚至没有注册错误。
我知道一个事实,即使不是所有这些浏览器都可以打印,因为您可以使用手机Chrome的菜单选择打印。
为什么不是 window.print()
期望(打开客户打印菜单)?是否有Android替代 window.print()
?
在文档中明确指出 iOS上支持该命令,Windows版Chrome以及Mac版Safari和Chrome,但不支持Android。
Android手机尚未支持打印,所以 window.print()
不起作用。这意味着您需要使用第三方应用程序来进行打印。你可以在这个 article 。
On Android devices (I have tested Nexus 5, Nexus 10, Galaxy S4 and Galaxy Tab 3), the window.print()
command in JavaScript doesn't do anything. As far as I can tell it doesn't even register an error.
I know for a fact that most if not all of these browsers can print because you can use mobile Chrome's menu to choose "print".
Why doesn't window.print()
trigger the behavior you would expect (opening the clients print menu)? And is there an Android alternative to window.print()
?
It is clearly stated in this Documentation, "The command is supported on iOS, Chrome on Windows and Safari and Chrome on Mac. It is not supported on Android."
Android phones don't have native support for printing yet, so window.print()
will not work. Which means you need to use third-party app to do the printing. You could find some alternatives in this article.
这篇关于在Android设备上使用window.print()或替代方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!