Skip to content Skip to sidebar Skip to footer

How To Print A Pdf?

I have a pdf url, embedded in a rectangular area of an iframe. I am trying to print it on click of a button . My code looks like this : JavaScript to print : function printPDF(pd

Solution 1:

Folks, just got a solution , which works fine for me .

functionprintPage(htmlPage)
{
    var w = window.open("about:blank");
    w.document.write(htmlPage);
    if (navigator.appName == 'Microsoft Internet Explorer') window.print();
    else w.print();
}

So, if it is MSIE, then we can just use : window.print();

Post a Comment for "How To Print A Pdf?"