Javascript Print Function is not working
ASP.NET
2
Posts
2
Posters
0
Views
1
Watching
-
function PrintPage() { printWindow = window.open("../xyz.pdf"); printWindow.print() } it's open the page but not print the page
-
function PrintPage() { printWindow = window.open("../xyz.pdf"); printWindow.print() } it's open the page but not print the page
jintalPatel wrote:
printWindow.print()
Is not correct. Its an instance of open page. window.print() is the command that works via JavaScript. You are opening a PDF, so this might not work, had it been a webpage you could had done something like:
w=window.open('about:blank');
//write some javascript to make the newly opened window print itself.
w.document.writeln("");
w.document.writeln("window.print()");
w.document.writeln("</"+"script>");</pre></x-turndown>