
This is position-independent page navigation and it’s important for built documents because pages may be added or moved after a bookmark is created, potentially changing the locations (and page numbers) of other pages in the document. The bookmark will always navigate to the same page view. Moving either the page or the bookmark to another location makes no difference in how it works. When a bookmark is created manually with the “New Bookmark” button on the Bookmarks Panel in Acrobat, its action is automatically set to “Go To Page” with the destination being the current page view (page number, zoom, and scroll). This works fine if we want our new bookmark to run a script, but it doesn’t help for making position-independent, page-navigation bookmarks. None of the other bookmark actions can be set from an automation script. The downside to using this function is that it can only create bookmarks that execute JavaScript. This function is easy to use and creates the bookmark in exactly the position it needs to be in. So we don’t need to worry about creating the first bookmark in the PDF, bookmark.createChild() works for creating any bookmark we might need.
#Bookmark pdf online free pricing buy purchase pdf
All PDF documents, even ones with no bookmarks at all, have an invisible top-level bookmark called doc.bookmarkRoot. This function creates a new bookmark underneath an existing bookmark. The most obvious method is the bookmark.createChild() function. Each has different advantages and disadvantages. Bookmark-creation methodsĪs stated earlier, there are two ways to create bookmarks. For these, a standard skeleton set of bookmarks can be created and automatically updated throughout the document-building process. All of these documents have a standard format, but contain varying contents. Documents that fit into this category include various kinds of report documents, such as an investment summary, a tax package, a corporate benefits report, an evidence package or an FDA submission. Another situation where automating bookmark creation is useful is in the workflow for creating the previously mentioned piece-meal-built documents, which will be the example for this article.Ī built document is a PDF that has a standard format and incorporates several documents from different sources that are organized and combined together, not necessarily at one time. For example, if the pages each have a title in the same location, regular Acrobat JavaScript methods can be used to scrape the titles off the page. The best situation is where the bookmark labels can be acquired from some ready source, possibly from text already on the page. The problematic issue is, where do the bookmark labels come from? This simple requirement limits the kinds of documents where bookmark automation makes sense. Since bookmarks require a label, creating them is not as easy to automate as some other tasks in Acrobat, but it can still be a worthwhile task to automate. Why automate bookmark creation?Īutomation saves time and reduces human error. For these situations, Acrobat provides two methods for automatically creating bookmarks with JavaScript. For example, documents that are converted without bookmarks, or documents that are built piece-meal over a period of time before being distributed. But there are some situations where neither of these methods is satisfactory. PDF bookmarks are normally created during the conversion from the original format or manually in Acrobat. Prerequisites: Basic Acrobat JavaScript Programming
