Copy link to clipboard
Copied
I want to get rectangular position with height & width on the mouse drag.
Can I make below code more dynamic? For example, eRect value should be come from mouse drag and it position should not be hardcoded.
var inch = 72;
var aRect = doc.getPageBox({ nPage: currentPage });
aRect[0] += 0.5 * inch; // from upper left hand corner of page.
aRect[2] = aRect[0] + 2 * inch; // Make it 2 inch wide
aRect[1] -= 0.5 * inch;
aRect[3] = aRect[1] - 0.5 * inch; // and 0.5 inch high
sigField = doc.addField("signature1", "signature", currentPage, aRect);
Copy link to clipboard
Copied
Use Tools > Prepare Form and add the signature field with the mouse.
Copy link to clipboard
Copied
My requirement is to place the new control based on mouse drag using javascript.
Copy link to clipboard
Copied
May be not possible.
Copy link to clipboard
Copied
No, it's not possible. The closest you can get to it is to use the mouse to mark the two opposite corners of the box (by clicking them) and then draw it. I've developed similar tools in the past so if you're interested I could help you set it up, for a fee.
You can contact me privately via [try6767 at gmail.com] to discuss it further.