8 Replies Latest reply on Nov 17, 2008 7:41 AM by gkaiseril

    Javascript to copy and paste hierchical bookmarks

      Hi!

      I want to use one or two JS doing the folowing jobs (in JS I#m a newbee):

      first work:
      1. collect all hierarchical bookmarks from a user-selected set of pdf-files, the bookmarked files becomes the parentbookmark of the bookmarks in this file.
      2. Order this bookmarks by files bookmark
      3. put this set of bookmarks into a new (or opened or user-selected) pfd-file

      second work:
      1. take all hierarchical bookmarks of a opened or user-selected pfd-file
      2. put this copied boomarks in a selection of other pfd-files (user-selected)

      If you kow such script, please let me know. If you are able to write this script(s), but you have to spend workingtime, let me know, how much money it will take to do this job.

      Werner
        • 1. Re: Javascript to copy and paste hierchical bookmarks
          hierarchical?

          I don't get your exact meaning, can you explain "first work" with a example?

          I think i am able to achieve your second work.

          contact suchengustb#gmail.com
          • 2. Re: Javascript to copy and paste hierchical bookmarks
            I need to be able to link (approximately 900) separate pdf files to a master (bookmark list). In other words I want to have a file called "index.pdf" that contains a complete index of bookmarks (shown in the left side navigation window) and a title page shown in the document (right side) window. As the bookmarks are selected, each of these separate pdf files are displayed in the existing document window. I want the bookmarks (navigation pane) to display all the time, while the contents of the document window change depending on what bookmark is selected. I do not want another window to open to display the selected bookmark file.

            ccc
            • 3. Re: Javascript to copy and paste hierchical bookmarks
              try67 MVP & Adobe Community Professional
              Hi ccc, I helped the original poster of this thread to achieve exactly what he wanted. Contact me by email and I will be able to do the same for you.
              • 4. Re: Javascript to copy and paste hierchical bookmarks
                Thom Parker Adobe Community Professional
                Excuse Me?? This is a public forum on Acrobat Scripting, not your private job service. The intention is that questions and answers are posted publically, so everyone can benifit. If the poster needs help beyond what can reasonably be posted here, thats fine, but there are no posts here. It doesn't even look like you tried to answer the question. What about the other people that might have the same concern??

                If you are not going to even make a small attempt at providing public help you shouldn't be on a public forum.

                Thom Parker
                The source for PDF Scripting Info
                www.pdfScripting.com

                The Acrobat JavaScript Reference, Use it Early and Often
                http://www.adobe.com/devnet/acrobat/
                • 5. Re: Javascript to copy and paste hierchical bookmarks
                  Thom Parker Adobe Community Professional
                  Now for a real answer. For both posts, the answer is yes and no.

                  Acrobat JavaScript has almost complete access to the entire bookmark tree. It can read the entire hierarchy, it can create new bookmarks, add JavaScript actions to bookmarks, and move bookmarks from place to place in the tree. But unfortunately it cannot access the actual actions performed by the bookmarks, so while a script can findout a bookmark's label and it's position in the bookmark tree, it cannot know exactly what a particular bookmark does.

                  I haven't tried moving a bookmark from one document into another. It's possible that this may actually work, however, most bookmarks are tied directly to the pages in thier own document, so if they could be copied they would be dead links in the new document. On the other hand, if the bookmark was setup to perform a JavaScript action, or something else that wasn't a destination in the current document, then it would probably work.

                  Now, about clicking on bookmarks that open other documents. You can certainly open a document in the same window as the current document, and always open it with the bookmarks displayed, this is a preferences setting. Unfortunately its a little difficult to make the bookmarks panel look as if it hasn't changed. The bookmarks would need to be identical in all document. And before you open the next document you'd have to collect the bookmark panel scroll postion and reset it on the newly opened doc. This can actually be done with JavaScript using the "doc.viewState" object. And I've written an article and some scripts for manipulating the doc.viewState object. It'll be posted on www.pdfscripting.com next week. Right you can get more info about bookmarks from this article at www.acrobatusers.com.

                  http://www.acrobatusers.com/tutorials/2008/10/js_auto_bookmark_creation/

                  Hope this helps,

                  Thom Parker
                  The source for PDF Scripting Info
                  www.pdfScripting.com

                  The Acrobat JavaScript Reference, Use it Early and Often
                  http://www.adobe.com/devnet/acrobat/
                  • 6. Re: Javascript to copy and paste hierchical bookmarks
                    try67 MVP & Adobe Community Professional
                    Thom, I answer plenty of questions here and on other related forums and I don't need to justify myself to you or anyone else. If I see that a question is not answered, or is not answered sufficiently, then what's the harm in offering my services through a private communication? If you don't like it, feel free to ignore it.
                    • 7. Re: Javascript to copy and paste hierchical bookmarks
                      Thom Parker Adobe Community Professional
                      Hey, I'm happy that there are knowlegable consultants answering questions on the forums. And I'm not above hawking my own wares on the forums. However, these are public forums, not a private communication site, and other people will be looking at the posts to try and answer there own issues.

                      If a question requires a 3rd party tool or service it's fine to recommend your own. But you should provide some explanation.

                      Thom Parker
                      The source for PDF Scripting Info
                      www.pdfScripting.com

                      The Acrobat JavaScript Reference, Use it Early and Often
                      http://www.adobe.com/devnet/acrobat/
                      • 8. Re: Javascript to copy and paste hierchical bookmarks
                        gkaiseril MVP & Adobe Community Professional
                        try67,

                        I for one pointed out that this was a user to user forum that encouraged exchange of code and you have chosen to provide private help. So, I for one think you need to follow your own advice.

                        There have been many other PDF consultants that have provided code and detailed help, Thom being just one of them. They also Duff Johnson, Ted Padova, Maxx Wyss, Lenorad Rosenthal, Carl Young and Kert Foss, to name just a few. Many of these people have posted lenghy articles, columns, and seminar presentations about how to do many things in Acrobat.