4 Replies Latest reply on Oct 3, 2013 5:20 AM by O Olsson

    Targeted Sorting and Page Extraction

    O Olsson

      I am a teacher that regularly scans student assignments into PDF files. These files are randomly sorted pages that consist of the entire class' work. The goal is to sort the PDF document according to some tag that identifies individual page(s) as belonging to a particular student. Currently the only way I know to "tag" the pages is to manually create bookmarks named for the student but, there seems no way to sort the pages by bookmark. Can this be done with Javascript? The ultimate goal is to be able to automate the process of sorting the pages by student (once they are tagged) and extract each student's work and finally save those individual files into the student's folder. Is this possible?


      I'm currently using Acrobat X Pro on a Mac with OS X 10.8.

        • 1. Re: Targeted Sorting and Page Extraction
          try67 MVP & Adobe Community Professional

          Yes, in principle that would be possible to do with a script. However, such a script is not simple to develop for someone without experience in this field.

          Also, there are other options for tagging the pages, such as using annotations (commenting tools).

          And if the pages are not hand-written it might even be possible to apply OCR (text recognition) to them and do the entire process automatically, without having to tag each page (range) manually.

          • 2. Re: Targeted Sorting and Page Extraction
            O Olsson Level 1

            I'm not sure what "experience in the field" means. If I list what my past experience is perhaps you can tell me if that qualifies. In a former life I programmed in ANSI C, ARexx, Perl, PerlTK, Visual Basic, Java, Javascript, Actionscript, and currently use XOJO as a cross-platform development environment. I used to write many in-house file parsing and batch graphics manipulation applications to process many thousands of files on Unix, Amiga, Mac, and Windows machines. So, I guess the question is – does the problem center around an understanding of programming fundamentals or are there some idiosynchratic details of Acrobat that are difficult to get around.


            Also, unfortunately, these pages would not benefit from OCR scanning. Manually tagging them is not a problem, in fact, setting bookmarks is quite easy. I wonder though, between bookmarks and other options like annotations, which are the easiest to access and manipulate programatically? And can they be used to sort the pages?

            • 3. Re: Targeted Sorting and Page Extraction
              try67 MVP & Adobe Community Professional

              Well, scripting in Acrobat has its own set of limitations and "tricks" that you need to know in order to do it correctly. For example, many methods can only be used from certain contexes, so some code that works when you run it in the console will not work when attached to a form field button, at least not until you create a script file that enables it to run, etc.


              I would go with annotations. They're as easy to create and maintain manually (via the Comments List) and for a script they're easier to work with because their page property is directly accessible, which is not the case with bookmarks.

              • 4. Re: Targeted Sorting and Page Extraction
                O Olsson Level 1

                Thank you for the direction. I would probably only use the console. I will begin experimenting with annotations. I've obviously got a lot of reading and experimenting to do.