Print more than one javascript copy

Asked

Viewed 245 times

2

I can make a print exit automatically in 3 copies? Same in this window below.

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

inserir a descrição da imagem aqui

2 answers

3


No, that’s not possible.

But you can see it as a good thing.

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

1

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

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.