function printPreview() {
    var checkboxes = getCheckedAnnotation();
    finalPreview('help', checkboxes, false);

    setTimeout(function () {
        var win = window.open("", "Print", "");
        win.document.write('<html><head><title>print</title>');
        win.document.write('<meta charset="UTF-8">');
        if (loadMermaid) {
            win.document.write('<script src="/static/mermaid/mermaid.min.js"></script>');
            win.document.write('<link rel="stylesheet" href="/static/mermaid/mermaid.css">');
            win.document.write('<script>mermaid.init(undefined, ".mermaid");</script>');
        }
        $.post('/get-css', function (data) {
            win.document.write("<style>" + encodeURIComponent(data) + "</style>");
            win.document.write('</head><body>');
            win.document.write(document.getElementById('help').innerHTML);
            win.document.write('</body></html>');

            win.document.close(); // for IE
            win.focus(); // for IE

            document.getElementById('help').innerHTML = '';
            setTimeout(function () {
                win.print();
                win.close();
            }, 100);
        });
    }, 1000);
}
/**
 * Open preview in new window and call print.
 */
Open preview in new window and call print.
Open preview in new window and call print .
function printPreview() {
    var checkboxes = getCheckedAnnotation();
    finalPreview('help', checkboxes, false);
    setTimeout(function () {
        var win = window.open("", "Print", "");
        win.document.write('<html><head><title>print</title>');
        win.document.write('<meta charset="UTF-8">');
        if (loadMermaid) {
            win.document.write('<script src="/static/mermaid/mermaid.min.js"></script>');
            win.document.write('<link rel="stylesheet" href="/static/mermaid/mermaid.css">');
            win.document.write('<script>mermaid.init(undefined, ".mermaid");</script>');
        }
        $.post('/get-css', function (data) {
            win.document.write("<style>" + encodeURIComponent(data) + "</style>");
            win.document.write('</head><body>');
            win.document.write(document.getElementById('help').innerHTML);
            win.document.write('</body></html>');
            win.document.close(); 
            win.focus(); 
            document.getElementById('help').innerHTML = '';
            setTimeout(function () {
                win.print();
                win.close();
            }, 100);
        });
    }, 1000);
}
function printPreview ( ) { var checkboxes = getCheckedAnnotation ( ) ; finalPreview ( 'help' , checkboxes , false ) ; setTimeout ( function ( ) { var win = window . open ( "" , "Print" , "" ) ; win . document . write ( '<html><head><title>print</title>' ) ; win . document . write ( '<meta charset="UTF-8">' ) ; if ( loadMermaid ) { win . document . write ( '<script src="/static/mermaid/mermaid.min.js"></script>' ) ; win . document . write ( '<link rel="stylesheet" href="/static/mermaid/mermaid.css">' ) ; win . document . write ( '<script>mermaid.init(undefined, ".mermaid");</script>' ) ; } $ . post ( '/get-css' , function ( data ) { win . document . write ( "<style>" + encodeURIComponent ( data ) + "</style>" ) ; win . document . write ( '</head><body>' ) ; win . document . write ( document . getElementById ( 'help' ) . innerHTML ) ; win . document . write ( '</body></html>' ) ; win . document . close ( ) ; win . focus ( ) ; document . getElementById ( 'help' ) . innerHTML = '' ; setTimeout ( function ( ) { win . print ( ) ; win . close ( ) ; } , 100 ) ; } ) ; } , 1000 ) ; }
Open preview in new window and call print.
Open preview in new window and call print .
// for IE // for IE