Print more than one copy in javascript

2

Can I make an impression come out automatically on 3 copies? Same in that window below.

window.onload = function() {
    window.print();
}

    
asked by anonymous 17.05.2017 / 14:05

2 answers

3

No, this is not possible.

But you can see this as a good thing.

Imagine if it was possible and you accidentally or a malicious website sent a parameter to print a very high number of pages and an unsuspecting user click OK to print without noticing the amount.

    
17.05.2017 / 14:11
1

According to the window.print() documentation there is no additional parameter for this function. Therefore, you can not send more copies. One solution (which is not very cool) is that you call the method 3 times:

window.onload = function() {
  window.print();
  window.print();
  window.print();
}
    
17.05.2017 / 14:13