Question
How to draw rectangular position with mouse drag in PDF using javascript?
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);
