Printing iframe with pdf src in mozilla firefox

JQuery Script

function printPdf(url) {
    var iframe = this._printIframe;
    if (!this._printIframe) {
        iframe = this._printIframe = document.createElement('iframe');
        document.body.appendChild(iframe);

        iframe.style.display = 'none';
        iframe.onload = function () {
            setTimeout(function () {
                iframe.focus();
                iframe.contentWindow.print();
            }, 1);
        };
    }
    iframe.src = url;
}

      

Above Script work in chrome, but in mozilla which downloads PDF does not print

+3


source to share





All Articles