Most helpful! That little tidbit was tasty You wouldn't happen to know how to assign the current bookmark name to a string would you?
I'm not sure what you mean by the current bookmark name, exactly. Can you elaborate?
Yes of course,
In Adobe, if you have multiple sections in your document, you can add bookmarks to jump to certain segments of the document. The would appear on the left hand side of the PDF, where you have three icons.
Pages - Go to specific pages using thumnails
Bookmarks - Go to specific points of interest using bookmark links
Search - See the results of your search
In my case, I would be combing multiple PDFs with the forementioned naming convention, and in the compiled version, the bookmarks are created automatically for each document name, so that you can jump to that document quickly. So if I click on the second bookmark to jump to that particular document, I would like to capture that specific bookmark name in a string that I can use to fill in my stamp details.
I read some information about the bookmark object, and it looked like it might be something like var str = this.bookmark.name; but that doesn't work.
OK. Is your code somehow triggering a particular bookmark that's present in the document and you then want to programmatically apply a stamp to the resulting page that's displayed? I don't think I have enough details yet of the workflow to best advise you. It may be easier to apply the stamps before you combine the documents.
The bookmark is an object and holds an array of "children" bookmarks. You need to access the various children to get the properties of an individual bookmark.
Have looked at and tried to run the examples in the JS Reference?
The following script displays the top most level book mark name:
var bkm = this.bookmarkRoot.children;
console.println( "Top level bookmark name: " + bkm.name );
You first need to get the 0 child level from the book mark root.
GJ - The bookmark would be selected manually and the stamp would reflect the change. The sole purpose of this is to combine and stamp hundreds of documents in the most efficient manner.
So for example:
I combine 3 docs by selecting them in Windows and right clicking and selecting combine:
I would have 3 bookmarks automatically when the combination occurs:
So when I select the bookmark 08363-G-5109-DWG-R-00001_A then click stamps - dynamic stamps , my two text boxes have used this bookmark to get Text 1 Text 2
Then I manually select the next bookmark and select stamp and it has used the next bookmark name to create a stamp with two text boxes now 08363-G-5109-DWG-R-00002 B
If I had to stamp them first them combine, I would have to open one, stamp, save close rinse and repeat 100 times then combine.
GK - I did have a poke around with bookmarkRoot.children, but the only result I ended up with was the word "Root" in the second box. I couldn't seem to determine if JS automatically builds the children collection based on the number of bookmarks off the root, or if I had to programmatically build it with an array.
The problem is there is no concept of "current bookmark" that you can get. Even if there were a means to get the title of the last bookmark that was checked, the user could have changed the page between clicking the bookmark and applying the stamp.
I still think this could be easier if you apply the stamps before you do the combine, assuming that you want to do it for every document that gets combined. You can do this with a batch process (aka Action) that automatically applies the stamp on the first page in a particular location, so there would be no need for the user to go through each combined document and manually apply the stamp. You can also flatten them if you don't want them to be altered or deleted after they're applied.
You do not build the array the array is returned by accessing the children property of the bookmark root.
You might find some help with Removing filename bookmarks created by Acrobat to see how to manipulate the array of bookmark root children.
Unfortunately the bookmarks with the .PDF name do not link to anything.