在Android手机和平板电脑上的window.print [英] window.print on Google android phones and tablets

查看:188
本文介绍了在Android手机和平板电脑上的window.print的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我的应用程序是在asp.net中开发的。

在我的一个页面(productinfo.aspx)中,我有一个名为&标记为

的HTML按钮为print。我在java脚本中处理单击此按钮,如下面的





$('#print')。click(function(function( $)

{

window.print();

});



以上是**在PC和智能手机上的所有浏览器中都能正常工作**除了谷歌Nexus手机和平板电脑外,还需支付
** **。它正在其他Android

手机上工作,如三星和索尼体验等。



我发现不支持window.print在谷歌android和我

应该使用谷歌云打印基于以下链接。



https://developers.google.com/ cloud-print / docs / gadget



但是这需要用户使用他们的Google ID登录GCP。

但是我的要求就像设备将无法连接到互联网

一样,它应该像其他设备一样提供打印对话框。



注意:

在Android Chrome浏览器中,浏览器菜单中有一个打印命令

点击单击显示打印对话框没有任何问题。



是否可以通过java脚本调用浏览器菜单命令,

我累了模拟(Ctrl + p)按键上的按键事件点击假设

它会触发浏览器的打印命令它也不起作用。





如果有任何人可以帮我解决这个问题

这将是非常有帮助的。



**谢谢你,

Kalidhas.P **

Hi All,

My application is developed in asp.net.
In one of my pages(productinfo.aspx) I have a HTML button named & labelled
as "print". I am handling the click of this button in java script like
below.

$('#print').click(function($)
{
window.print();
});

The above is **working fine** in all browsers on PC and in smartphones as well
**except Google Nexus mobiles and tablets**. It is working in other android
mobiles like Samsung and Sony experia etc..

I came to know that window.print is not supported in Google android and I
should use Google cloud print based on the following link.

https://developers.google.com/cloud-print/docs/gadget

But this requires the user to be logged into to GCP with their Google ID.
But my requirement is like the device will be not connected to Internet
and it should provide the print dialog as like in other devices.

Note:
In Android chrome browsers there is a print command in the browsers menu
clicking on the click of that is showing the print dialog without any problem.

Is it possible to invoke the browsers menu command through java script,
I tired simulating (Ctrl+p) key press event on the button click assuming
that it will trigger the browser's print command it too didn't work.


It would be very much helpful if any one can help me with a solution for
this issue.

**Thank You,
Kalidhas.P**

推荐答案

('#print')。点击(功能(
('#print').click(function(




{

window.print();

});



以上是**在PC和智能手机的所有浏览器中都能正常工作**

**除了谷歌Nexus手机和平板电脑**。它正在其他Android

手机上工作,如三星和索尼体验等。



我发现不支持window.print在谷歌android和我

应该使用谷歌云打印基于以下链接。



https://developers.google.com/ cloud-print / docs / gadget



但是这需要用户使用他们的Google ID登录GCP。

但是我的要求就像设备将无法连接到互联网

一样,它应该像其他设备一样提供打印对话框。



注意:

在Android Chrome浏览器中,浏览器菜单中有一个打印命令

点击单击显示打印对话框没有任何问题。



是否可以通过java脚本调用浏览器菜单命令,

我累了模拟(Ctrl + p)按键上的按键事件点击假设

它会触发浏览器的打印命令它也不起作用。





如果有任何人可以帮我解决这个问题

这将是非常有帮助的。



**谢谢,

Kalidhas.P **
)
{
window.print();
});

The above is **working fine** in all browsers on PC and in smartphones as well
**except Google Nexus mobiles and tablets**. It is working in other android
mobiles like Samsung and Sony experia etc..

I came to know that window.print is not supported in Google android and I
should use Google cloud print based on the following link.

https://developers.google.com/cloud-print/docs/gadget

But this requires the user to be logged into to GCP with their Google ID.
But my requirement is like the device will be not connected to Internet
and it should provide the print dialog as like in other devices.

Note:
In Android chrome browsers there is a print command in the browsers menu
clicking on the click of that is showing the print dialog without any problem.

Is it possible to invoke the browsers menu command through java script,
I tired simulating (Ctrl+p) key press event on the button click assuming
that it will trigger the browser's print command it too didn't work.


It would be very much helpful if any one can help me with a solution for
this issue.

**Thank You,
Kalidhas.P**


这篇关于在Android手机和平板电脑上的window.print的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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