Expand my Community achievements bar.

Adding bookmarks to an interactive form?

Avatar

Former Community Member
I am trying to add bookmarks to my navigation on my PDF form. I add the bookmarks in Acrobat and they work but when I save them and open them again the bookmarks are there but they don't work. Is this because it is a form? Any ideas on how I can get this done?
3 Replies

Avatar

Former Community Member
I tried creating bookmarks from a button as follows (in JavaScript):



event.target.bookmarkRoot.createChild("my bookmark", "this.pageNum = 0;");


and it works even after I save, close and re-open the form in Acrobat Pro. Of course, if you open the form in Designer, save, close and then re-open in Acrobat, they won't be there anymore because annotations, such as bookmarks, get stripped-out when PDF documents are opened in Designer.



You might want to try dynamically creating the bookmarks every time the form is loaded.



I've attached two sample forms:
CreateBookmarksOnLoad.pdf which dynamically creates bookmarks when the form is loaded (note the guard form variable to prevent creating them every time a Layout event is fired) and
CreateBookmarks.pdf which creates bookmarks at the push of a button (you should be able to save, close and re-open this PDF
all within Acrobat and have the bookmarks still work.



Stefan

Adobe Systems

Avatar

Former Community Member
These solutions would be perfect. The only problem I am running into is they don't work in Reader?



I am trying to recreate an interactive form that my boss found and it uses bookmarks in reader but I can't figure out how to get them to work even with the two options you attached.

Avatar

Former Community Member
Unfortunately, the Bookmark object (which is used to create the bookmarks from JavaScript) isn't available in Reader (and you can't even Reader-Extend the form to get the Bookmark object).



If you need to have bookmarks in Reader, I suggest you use a different technique where you use
xfa.host.setFocus to set focus to text fields at different places on your form. This would act as a bookmark without actually being a Bookmark in Acrobat. See post #6 in the
Links Within PDF thread for an example.



Stefan

Adobe Systems