Solved

Search and Bookmark Javascript for Acrobat

Posted on 2009-07-15
3
459 Views
Last Modified: 2012-08-13
I need a Javascript to wok in Acrobat that will search through a searchable pdf documents for specific phrases and create a bookmark with the phrases name when if finds them.

This is a static lists of phrases eg. "PATIENT PROFILE", "COLONOSCOPY" ...

I will need to do this in a folder of approximately 1200 documents.
0
Comment
Question by:scsoil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
mohan_sekar earned 125 total points
ID: 24859644
If you want to search PDF documents for phrases in a folder and create bookmarks, you got to use some PDF library like iText. Visit http://www.lowagie.com/iText/ for more info
0
 
LVL 1

Expert Comment

by:ForLoop5
ID: 37745487
I was able to do this with just java script.  I also create a new file for each page and give it the name of my bookmark.


var root = this.bookmarkRoot;
var RegularExpression  =  new RegExp(/\n|\r|\t|\s/);

for (var i = 0; i < this.numPages; i++)
    {
        numWords = this.getPageNumWords(i);
        var PageText = "";
            var FoundSASID = 0;
       
            for (var j = 0; j < numWords; j++) {
            var word = this.getPageNthWord(i,j,false);
                  PageText += word;

                  var strMatches = PageText.match('SASID:');
              if (strMatches != null) {
                        // Found text SASID: So reset the PageText to nothing and set the FOundSASID to 1
                        FoundSASID = 1;
                        PageText = "";
                        }

                  var newWord = PageText.match(RegularExpression);
                  var foundSpace = PageText.match(' ');
                  if (newWord != null || foundSpace != null) {
                        if (FoundSASID==1) {                                                                          
                          this.extractPages({nStart:i, cPath: PageText + ".pdf"});
                              root.createChild(PageText,"this.pageNum=" + i, i);
                                     
                              FoundSASID = 0;
                        }
                        if (FoundSASID==0) {
                              PageText = "";
                        }

                        }
            }
    }
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Jquery form 9 42
Reactjs with .NET 3 78
How to change the colour of columns using dynamic data for google charts 3 49
Duplicate Elements with JS / jQuery 3 24
Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
PaperPort is a popular document imaging/management product from Nuance Communications (http://www.nuance.com/). It is in widespread use by both individuals (http://www.nuance.com/for-individuals/by-product/paperport/index.htm) and businesses (http:/…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question