I'm not a scripter, so I'm turning to the forum for help.
Using Acrobat X, I want to create an Action Wizard to add a pre-populated combo box to a PDF. (Our printing company needs to specify a "Printed In" Country on the page when they print it - could be printed in US, China, or elsewhere).
The AW side is easy, but I know that it will need to call a javascript to create the combo box. It's the javascript that I need help with.
From other script samples I looked at, I can figure out how to set the values of the field and its location - it's the code to create the combo box I need, which is probably only a couple of lines. Anyone willing to help?
Combo Box Values:
China
U.S.A.
Enter Country Name
Location is bottom left of form, I'll have to fine tune the exact location.
var inch = 72; // points per inch
var page = 0; // zero based page for field
// options for selection by the field
var aOptions = new Array("China", "U.S.A.", "Enter Country Name");
// Position a rectangle (.5 inch, .5 inch)
var aRect = this.getPageBox( {page: page} );
aRect[0] += .5 * inch;// from upper left hand corner of page.
aRect[2] = aRect[0] + 1.5 * inch;// Make it 1.5 inch wide
aRect[1] -= .5 * inch;
aRect[3] = aRect[1] - 24;// and 24 points high
// Now construct a combo box
var f = this.addField({cName: "Country", cFieldType: "combobox", nPageNum: page, oCoords: aRect})
// complete the properties of the field
f.delay = true; // turn off display refresh
f.borderStyle = border.s; // border style
f.strokeColor = color.black; // border color - black
f.lineWidth = 2; // border width
f.fillColor = color.transparent; // background color - clear
f.setItems(aOptions); // set options for selection
f.editable = true; // allow edit of options
f.textSize = 10; // 10 point size for text
f.textColor = color.black // text color - black
f.textFont = font.Times; // font name
f.delay = false; // restore display refresh
George Kaiser