11 Replies Latest reply on Dec 3, 2008 5:45 AM by MarkWalsh

    Export bookmarks to text

      Hi, Folks!

      I am looking for a tool to export pdf bookmarks to text. The AutoBookmark plug-in allows this. But it comes as a whole bunch of functions and is to expensive for me as a student.
      The friendly author of the software told me that I can do this in Acrobat Professional by writing a simple Acrobat JavaScript and executing it as a batch command.
      But I have no ideas about JavaScript and batch commands.

      Would anybody of you kindly help me on this subject with an easy step-by-step instruction?
      Because I am preparing exams I don't have a lot of spare time.

      Thanks in Advance

      Alexander
        • 1. Re: Export bookmarks to text
          (Aandi_Inston) Level 1
          >Would anybody of you kindly help me on this subject with an easy step-by-step instruction?

          You want to learn how to become a JavaScript programmer in order to
          write this program? This may not be the best use of your time.

          >Because I am preparing exams I don't have a lot of spare time.

          So you want someone to do this for you?

          Aandi Inston
          • 2. Re: Export bookmarks to text
            George_Johnson MVP & Adobe Community Professional
            The Acrobat JavaScript Reference has some sample code that writes the bookmark tree to the JavaScript console, from which you can cut & paste.

            George
            • 3. Re: Export bookmarks to text
              Level 1
              Thank you for your replies!

              George, may I ask you to kindly provide the step by step instructions for your tip? I opened Acrobat and searched for Java in the help section, but did not find anything.
              To me, Java is an Island somewhere in the Indian Ocean...

              Thanks,

              Alexander
              • 4. Re: Export bookmarks to text
                (Aandi_Inston) Level 1
                Don't search for Java: you won't be using Java. You need to use
                JavaScript, something different. These are NOT interchangeable, and it
                isn't "Java Script".

                Programming information is not included in the help file. Developers
                need to get the Acrobat SDK, which has lots of detail. You don't need
                the whole SDK, you can get started with the documents on here:
                http://www.adobe.com/devnet/acrobat/javascript.html .

                Aandi Inston
                • 5. Re: Export bookmarks to text
                  Level 1
                  Thank you Aandi for your answer!

                  To be honest I think I'll just forget about the idea of using javascript and all. I guess I'll buy the tool that does my job. Maybe after my exams in winter I'll have another look into it.
                  I hope you don't regret having helped me. Please understand that as a student I am always trying to save time and money (well, I guess everybody is, but when you don't have a salary it gets more extreme).

                  Best regards,

                  Alexander
                  • 6. Re: Export bookmarks to text
                    try67 MVP & Adobe Community Professional
                    Hi Alexander,

                    Contact me by email. I can help you out with this.
                    • 7. Re: Export bookmarks to text
                      Hi,

                      I have a few hundred PDF's that I need to save as text. These are PDFs which have been OCRd - meaning that I can currently open each one up manually, select "copy", and then "paste" the contents into a text editor. However, when I try to set up a batch to have this happen automatically, it doesn't work.

                      I'm sure there is an easy way to do this, but I cannot figure it out. Any help would be much appreciated!

                      Thanks,

                      - Isaac
                      • 8. Re: Export bookmarks to text
                        George_Johnson MVP & Adobe Community Professional
                        Try using the doc.saveAs JavaScript method. With it, you can specify what format you want to convert to, but you'll have to deal with the security restrictions by setting the code in a folder-level JavaScript file. See the Acrobat JavaScript reference for more information.

                        George
                        • 9. Re: Export bookmarks to text
                          gkaiseril MVP & Adobe Community Professional
                          If you goto the Acorbat Developers site, http://www.adobe.com/devnet/acrobat/ , and download the the batch seqences files, http://www.adobe.com/devnet/acrobat/pdfs/batch_sequences.pdf and http://www.adobe.com/devnet/acrobat/downloads/batchseq.zip , there is a batch sequence to create a PDF report of the bookmarks in a PDF or PDFs which could then be saved as a text file.
                          • 10. Re: Export bookmarks to text
                            Level 1
                            Thanks very much for your reply.

                            The pdf is an image of an old typed page and comes already OCR'd. If I open up the PDF in Acrobat Pro and "Export" to a text file, the text file comes out empty (same for exporting to word format)... Only if I manually "select all" and "copy" and "paste" the text into a text editor can I get what I want. Apparently the text that I "copy" and "paste" is stored in a hidden "layer"(?) that the export function doesn't have access to. I am trying to figure out how to access this "layer" through a command that can be part of a batch script.

                            Thanks,

                            Isaac
                            • 11. Re: Export bookmarks to text
                              MarkWalsh Level 4
                              If you're on a Mac, you can try pdftotext:

                              http://www.bluem.net/downloads/pdftotext_en/

                              You can use it in Terminal, or in applescript. I use the following applescript saved as an application to batch multiple files:

                              on open theFiles
                              repeat with pdfFile in (theFiles as list)
                              set thePath to POSIX path of (pdfFile)
                              set commando to "/usr/local/bin/pdftotext -layout " & quoted form of thePath
                              do shell script commando
                              end repeat
                              end open

                              It has worked with the PDFs I have used, don't know if it will work with your OCR'd PDFs.