Skip to main content
Inspiring
May 20, 2016
Answered

print button to print page 10 with dialog asks user how many times to print page 10

  • May 20, 2016
  • 1 reply
  • 301 views

Hi, all

Would like javascript to attach to a button which does the following:-

asks user in dialog box how many copies of page 10 they wish to print.

Sounds easy hmmm not to me....unfortunately.

If this cannot be done is it possible to have page 10 selected in the normal print dialog box on a button....which brings up the print dialog and all you have to do is select how many copies.

Thanks in advance

Stephen

This topic has been closed for replies.
Correct answer try67

You can use this code to do that:

var copies = Number(app.response("How many times do you want to print page 10?","",""));

if (!isNaN(copies) && copies>0) {

    var pp = this.getPrintParams();

    pp.firstPage = 9;

    pp.lastPage = 9;

    pp.NumCopies = copies;  

    this.print(pp);  

}

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
May 20, 2016

You can use this code to do that:

var copies = Number(app.response("How many times do you want to print page 10?","",""));

if (!isNaN(copies) && copies>0) {

    var pp = this.getPrintParams();

    pp.firstPage = 9;

    pp.lastPage = 9;

    pp.NumCopies = copies;  

    this.print(pp);  

}