Dynamically place a Static signature script
I have multiple PDFs requiring an e-signature (not digital). However, the signature line isn't consistent across all PDFs. I need to search the PDF for a specific phrase, then insert the e-signature above that phrase. I have created a Action to watermark the signature, but since the signature line isn't consistent, this doesn't work. I understand this will take scripting to do and I've tried to find answers, however, every script I've found is applied to a static location and not a dynamic location. This script looks extremely promising (though it uses a digital signature, not an e-signature). Here's what I have so far:
var phrase = "Signature of: Name";
var currentPage = this.pageNum;
var found = this.getPageNthWord(currentPage, 0, phrase);
if (found.length > 0) {
var bbox = this.getPageNthWordQuads(currentPage, 0)[found[0]];
var x = bbox[0];
var y = bbox[1];
var signatureImage = this.addWatermarkFromFile("FILE LOCATION", { opacity: 1, onTop: true, bUseAsBackground: false, nRotation: 0 });
signatureImage.page = currentPage;
signatureImage.display = display.visible;
signatureImage.rect = [x, y - 20, x + 60, y];
signatureImage.borderWidth = 0;
