These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Creating Optional Print Button using popUpMenuEx

Duniagdra
Registered: Sep 24 2008
Posts: 140
Answered

I thought I'd be clever and create a print mutton menu allowing selectable printing options. This is my code:

var strResult = app.popUpMenuEx({cName:"Character Sheet",cReturn:print({nStart: 0, nEnd: 1})},
                     {cName:"Summary Sheet", cReturn:print({nStart: 2, nEnd: 2})},
                     {cName:"Log Sheet", cReturn:print({nStart: 3, nEnd: 3})},
                     {cName:"Power Cards", cReturn:print({nStart: 4, nEnd: 5})},
                     {cName:"All", cReturn:print({nStart: 0, nEnd: 5})});

In testing it I'm finding the print is executing before the menu can come up. Am I trying this wrong, because when I cancel I have to cancel 5 times before I see the menu.

Thanks in advance for any help provided,
Jim
The All Time Professional Amateur Hack

My Product Information:
Acrobat Pro 8.1.2, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
The value of cReturn should be a string, not a statement. You could set the string to something like:

cReturn: "2,4",

which would represent the start and end page numbers, parse them out (e.g., using the string.split method), and use them as the nStart and nEnd parameters of a subsequent print statement.

George
Duniagdra
Registered: Sep 24 2008
Posts: 140
George_Johnson wrote:
The value of cReturn should be a string, not a statement. You could set the string to something like:cReturn: "2,4",

which would represent the start and end page numbers, parse them out (e.g., using the string.split method), and use them as the nStart and nEnd parameters of a subsequent print statement.

George
Took w while, but I figured out how to accomplish what you suggested. Thanks George for your help.

Thanks in advance for any help provided,
Jim
The All Time Professional Amateur Hack