"Move" button creation by JS
Hello,
I am beginner in javascript in acrobat.
My goal is to create signature fields by javascript (executed from action wizard).
I already made all fields with no problems (one field as example)
var cm = 72 / 2.54;
var aRect = this.getPageBox( {nPage:0} );
aRect[0] += 7.5*cm;
aRect[2] = aRect[0]+7*cm;
aRect[1] -= 19.73*cm;
aRect[3] = aRect[1]-0.7*cm;
var f = this.addField("Created", "signature", 0, aRect);
Now I need to center all fields to the scanned original.
The reason is that documents to be signed are mostly scanned, so they are shifted and rotated a little bit, so fields which I add are not fits to the scanned original.
I write moving scripts for all fields together in selected direction (rotation is not necessary).
var mm = 72 / 25.4;
var s = this.getField("Created");
var aRect = s.rect
aRect [1] += 0.5
aRect [3] += 0.5
s.rect = aRect
Now I want to create buttons located on the unused region of original document for moving fields left, right, up and down.
All shall be dony using JS.
My idea is to use "setAction" for button field named "UP", which will execute moving script as provided above.
How to create in JS "UP" button which will call moving script as provided?
