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

Print documents from combobox or pop up menu

halzamoras
Registered: Apr 12 2010
Posts: 3

Hi guys,
I've been trying to find the best way to get a pdf to print other pdfs from a combobox or even a pop up manu, but not luck yet. I'm a designer, not a programer, so i'll apreciate you use small words when you try to explain to me :D
 
I haven't found a script that will print another document so in the mean time i'm setteling with opening the document and plancing in it an autoprint script.
 
Additionally to the code you'll see down here, i have a combobox that lists all the options mentioned down here:
  
//
//Aceptar:Annot1:MouseUp:Action1
//
/*********** pertenece a: AcroForm:Aceptar:Annot1:MouseUp:Action1 ***********/
if (CboImpresion="doc1")
{
app.launchURL("http://ndo/route1.pdf", true);
}
else if (CboImpresion="doc2")
{
app.launchURL("http://ndo/route2.pdf", true);
}
else if (CboImpresion="doc3")
{
app.launchURL("http://ndo/route3.pdf", true);
}
else if (CboImpresion="alldocs")
{
app.launchURL("http://ndo/route1.pdf", true);
app.launchURL("http://ndo/route2.pdf", true);
app.launchURL("http://ndo/route3.pdf", true);
}
else
{
var msg = "No option selected"
app.alert(msg);
}
//
//
  

My Product Information:
Acrobat Pro 9.4.2, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
To open another file you need to use app.openDoc(), which returns a Doc object, which you can then print using this.print(). Read carefully the reference for openDoc. It will only work if the files are disclosed.

Regarding your script, there are several errors in it.
First of all, you're using the assignment operator (=) where you should use the comparison operator (==).
Also, you're using an undeclared variable in an if-statement (CboImpresion).

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

halzamoras
Registered: Apr 12 2010
Posts: 3
Thanks Try67, as I said, I'm a designer and I have no Idea on how to program javascript... so for me it's good I don't have more errors :D

I'll read about the openDoc(). I already fixed the (=), but the questions is how to declare a variable in java?? My combobox's name is CboImpresion and the doc1, doc2, doc3, and alldocs are my variables there, isn't that enought?




try67
Expert
Registered: Oct 30 2008
Posts: 2398
To access a field's value you need to use the getField() method of the Doc object.
If you want to access the same field that triggered a certain action you can also use the event object.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com