Copy link to clipboard
Copied
I have an evidence form I want to be able to control specific printing sequences when the user presses print. Can anyone help me out with code, or point me in the direction, that does the following:
Thank you!!
Copy link to clipboard
Copied
For #2, use this code as the Mouse Up script of your print button:
if (app.alert("Would you like to print an evidence envelope?",2,2)==4) {
app.alert("Instructions for printing: ...",3);
this.print({nStart: 1, nEnd: 1});
}
For #3: No, you can't hide a page, unless the file is opened only in Acrobat. If it's opened in Reader you can delete it, if it was originally spawned from a Template object, and then re-spawn it, I guess, but I think it's not worth the trouble, to be honest.
Copy link to clipboard
Copied
Try this:
if (app.alert("Would you like to print an evidence envelope?",2,2)==4) {
app.alert("Instructions for printing: ...",3);
this.print({nStart: 0, nEnd: 0}); // print page 1
this.print({nStart: 1, nEnd: 1}); // print page 2
} else {
this.print({nStart: 0, nEnd: 0}); // print page 1
}
Copy link to clipboard
Copied
First point: Not possible!
Copy link to clipboard
Copied
Which part? Or all of it? If so, why? I'm trying to learn.
Copy link to clipboard
Copied
"Disable the ability to print from the menu or Ctrl-P so that the user only has the option to use the print button. "
Copy link to clipboard
Copied
Unless printing is prohibited by a security policy the user will always be allowed to print the file. You can't stop them from doing so.
Copy link to clipboard
Copied
For #2, use this code as the Mouse Up script of your print button:
if (app.alert("Would you like to print an evidence envelope?",2,2)==4) {
app.alert("Instructions for printing: ...",3);
this.print({nStart: 1, nEnd: 1});
}
For #3: No, you can't hide a page, unless the file is opened only in Acrobat. If it's opened in Reader you can delete it, if it was originally spawned from a Template object, and then re-spawn it, I guess, but I think it's not worth the trouble, to be honest.
Copy link to clipboard
Copied
Thank you very much! That works like a champ.
Copy link to clipboard
Copied
I can't get the evidence sheet only to print when I press no.
Copy link to clipboard
Copied
I don't follow... If you press No in the first dialog the print window will not open.
Copy link to clipboard
Copied
Correct.
Copy link to clipboard
Copied
So what's the problem?
Copy link to clipboard
Copied
I actually want it to print the evidence sheet only if they select no.
Is there a way to designate what tray to print from? For instance, let's say I have a piece of evidence I need to package. I would fill out the form, click print, the evidence sheet would print from tray 3. If I sele t yes for the envelope it would print from tray 1.
Copy link to clipboard
Copied
Isn't that what happens if they click Yes, too? So what's the point of asking them?
And no, you can't select a tray in the script, only a printer.
Copy link to clipboard
Copied
If they say no it should print page 1 of 2. If they say yes they need both with the 1 of 2 automatically going to the default printer and them being able to choose the tray on the 2 of 2
Copy link to clipboard
Copied
Would it be possible to click print. Get a the print window for 1/2 AMF then ask if the user needs an envelope?
Copy link to clipboard
Copied
Try this:
if (app.alert("Would you like to print an evidence envelope?",2,2)==4) {
app.alert("Instructions for printing: ...",3);
this.print({nStart: 0, nEnd: 0}); // print page 1
this.print({nStart: 1, nEnd: 1}); // print page 2
} else {
this.print({nStart: 0, nEnd: 0}); // print page 1
}
Copy link to clipboard
Copied
You are truly awesome. Thank you.
Can you please shoot me an e mail?
Copy link to clipboard
Copied
You're welcome!
I don't know your address but you can contact me via [try6767 at gmail.com].
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more