-
1. Re: Determine the coordinates of a bookmark.
Dave Merchant Sep 5, 2013 6:43 PM (in response to MaxCO2012)You cannot directly access the destination property of a bookmark or link using the JavaScript API.
The only way to find out where a bookmark goes is to execute it.
-
2. Re: Determine the coordinates of a bookmark.
MaxCO2012 Sep 6, 2013 6:06 AM (in response to Dave Merchant)Thanks for the clarification.
Surely, I can't be the first person needing a method to insert a digital signature field in a dynamic location.
Any suggestions?
-
3. Re: Determine the coordinates of a bookmark.
Dave Merchant Sep 6, 2013 8:27 AM (in response to MaxCO2012)You're the first on here!
Acrobat is not designed to be used as a fully-automated tool, so a lot of the things that would make that possible are missing. There are also some parts of the JavaScript API that never got due attention, the bookmark and link objects being prime examples. It may change going forward, can't possibly say.
You can find the coordinates of words on a page with JS, and you can cycle through every word on every page to 'search' for something. So in theory if you block out the signature's position using a unique sequence of characters (filled with white so they don't appear on screen) you could use them to map in your signature field.
Look at example 2 for doc.addLink() in the Acrobat JavaScript API documentation ( http://bit.ly/AXISDKH ). It does pretty much the same thing, but you'd be adding a form widget (with doc.addField) instead of a link object.
-
4. Re: Determine the coordinates of a bookmark.
MaxCO2012 Sep 6, 2013 8:39 AM (in response to Dave Merchant)Excellent suggestion. I'll give that a try and see how the speed goes finding that "white" word.
I was also working towards determing the location of the bookmark in the Word template data and making the coordinates calculation from there, but bookmark coordinates are proving elusive also.
And yet another idea, similar to your suggestion, is to place an invisible rectangle in the Word template and use those coordinates.
Thanks again.
-
5. Re: Determine the coordinates of a bookmark.
Test Screen Name Sep 6, 2013 9:00 AM (in response to MaxCO2012)Part of the issue is the complexity of bookmarks, which would need a huge object model in JavaScript to represent it. Bookmarks, links and form fields can have one or more actions associated with them. The set of actions is open ended but include at least 15 different types, many with complex sub-dependencies. Only three of these types could be said to have a coordinate, but you should be aware that in no case is the coordinate usually a small area. Generally it's an entire page or chunk of page. What is preserved precisely is the source of a link area, but there is no method to get that either.


