Finding text and determining a coordinate
Hello everyone! I am trying to solve a problem: automatic insertion of a signature into a stamp on each sheet of a document.
At the moment, I managed to create a dynamic stamp with a signature, refer to it from the code and insert the signature at the specified coordinate:
app.addMenuItem({ cName: "Little_stamp", cUser: "Little_stamp", cParent: "Help", nPos: -1,
cExec: "myTrustedFunction()", cEnable: "event.rc = (event.target != null);"});
function myTrustedFunction() {
for (var p = 0; p < this.numPages; p++) {
var annot = this.addAnnot({
page: p,
type: "Stamp",
author: "Acrobat",
name: "myStamp",
rect: [175, 40, 205, 60],
AP: "#mySig" });
app.trustedFunction(myTrustedFunction);... but unfortunately this method sometimes fails because the coordinate is changing. Therefore, I decided to implement another way: find a specific word, find out its coordinates and step back 20 points from it. Tell me how to do this?
