3 Replies Latest reply on Mar 20, 2017 1:13 PM by try67

    Help with a script that would sort a large document?

    Chris_Armes

      Hello all - new to the forum. I have a 14,000 pg. (and growing) document, each page has a printed page(document) number in the upper right hand corner. Since the document number is always in the same place on the document, I would like to build a script that would enable me to use Text Recognition and then put the pages in order per this printed number.

       

      There is a possibility that each page/document number might appear twice in the file (one customer copy and one shop copy) and some numbers could be skipped altogether. The finished document might look something like this 1,1,2,3,3,5,6,7,7,8,10,10...ect...

       

      These documents are returned to me in a random order and I would like to be able to scan them as they come in and "feather" them in to the existing document in order per the document number.

       

       

      Thanks in advance for any thoughts on this issue.

      Chris

        • 1. Re: Help with a script that would sort a large document?
          try67 MVP & Adobe Community Professional

          This could be possible with a script, IF the results of the Text Recognition process are reliable AND the text always appears at the same spot (more or less) on the page. The implementation is a bit tricky, though. You would need to examine the quads of each word on the page and compare it to the area where the page numbers are supposed to be. If a match if found you add this page to an array that holds the original page number and the new page number. If no match is found then you need to decide what to do with those pages.

          Then you can either move the pages around using a sorting algorithm to the new order, or (my preferred approach) extract them as individual pages and then re-combine in the correct order.

           

          As I said, this is not a simple task. If you're interested in hiring someone to develop it for you feel free to contact me privately at try6767 at gmail.com.

          • 2. Re: Help with a script that would sort a large document?
            Chris_Armes Level 1

            Thanks for your input. Interesting, the numbers are all in the same place.

             

            I wonder if it's possible to automate bookmarks for each page based on these numbers and then sort numerically by bookmark... end result would be the same.

             

            It's probably not worth anything to me monetarily, as it is I can perform a search for the document by number and find what I need. I'm trying to stay away from manually sorting, just trying to clean up the stack as it were...

             

            Chris

            • 3. Re: Help with a script that would sort a large document?
              try67 MVP & Adobe Community Professional

              Yes, doing it with bookmarks is possible as well, but it's not much

              simpler...

               

              On Mon, Mar 20, 2017 at 8:51 PM, Chris_Armes <forums_noreply@adobe.com>