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 as dialog as like in other devices.
Note: In Android chrome browsers there is a print command in the browsers menu clicking on that is showing the print dialog without any GCP.
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.