У меня есть веб-мобильное приложение, на кнопке на странице aspx я поместил приведенный ниже код для печати страницы, он работает нормально во всех браузерах, но когда я помещаю свое приложение в webview
в android, оно не работает (нет ответа после нажатия)
<div id="options">
<input id="printpagebutton" type="button" class="printToprinter" value="PRINT" onclick="printpage()" />
</div>
<script>
function printpage() {
//Get the print button and put it into a variable
var printButton = document.getElementById("printpagebutton");
//Set the button visibility to 'hidden'
printButton.style.visibility = 'hidden';
//Print the page content
window.print()
//Restore button visibility
printButton.style.visibility = 'visible';
}
</script>
i did all the above code and it is failed inside Webview, it is working
fine through browser :
HttpContext.Current.Response.ClearHeaders();
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Expires = 0;
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.AddHeader("Content-Disposition",
"Attachment;FileName="+outletid+ "Check.pdf");
HttpContext.Current.Response.ContentType = "application/force-
download";//Application/pdf
HttpContext.Current.Response.BinaryWrite(net.DownloadData(openurl));
HttpContext.Current.Response.End();
Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "chrome";
process.StartInfo.Arguments = openurl + " --new-window";
process.Start();
string UrlForAndroid = "http://drive.google.com/viewerng/viewer?
embedded=true&url="+openurl;
this.Page.Response.Redirect(UrlForAndroid, true);
this.Page.Response.End();
this option open the pdf, but when i try to print it return white page