I have the following code:
<input type="button" value="Print" onclick="window.print(); return false;">
Which works in all browsers but it is doing nothing ( not opening print dialog box ) in ipad chrome browser.
How can I solve this problem?
However if I do manually print with chrome settings print then its working.
Multiple questions on SO show (1, 2, 3) that it's currently not possible to print in Chrome for iOS due to Apple's policy on using alternative browser engines.
Another solution is to use a third-party printing service: http://www.printfriendly.com
It's a chrome bug/feature. window.print
is available, it works and do nothing. Try this code
:
try {
window.print()
}catch(e) {alert(e.message)}
The alert will not be shown. Also class UIWebView
can use UIKit Printing API
P.S. Chrome using UIWebView
.
Try this:
function goPrint(){
window.print();
if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
window.location.reload();
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With