Print button in hard copy

后端 未结 1 1084
走了就别回头了
走了就别回头了 2021-01-25 11:39

I have a printing script in javascript saved in this fiddle. But I unable to remove the print button from the hardcopy. Is there any other methods to remove the print button? Th

1条回答
  •  伪装坚强ぢ
    2021-01-25 12:05

    Add the style declaration to preview window:

    function printpage() {
        var data = 'Sample Report
    Sample Report
    Sample Report
    '; data += '
    '; data += ''; myWindow = window.open('', '', 'width=800,height=600'); myWindow.innerWidth = screen.width; myWindow.innerHeight = screen.height; myWindow.screenX = 0; myWindow.screenY = 0; myWindow.document.body.innerHTML = data; myWindow.focus(); }

    http://jsfiddle.net/4d3jj/2/

    0 讨论(0)
提交回复
热议问题