I am new to JS on acrobat. Any help would be appreciated!!
There is no "out of the box" solution for this. It will have to be custom-developed to match the structure of the TOC in your files.
I've developed similar scripts in the past and would be happy to take a look at a sample file and let you know if I think it's doable or not, and if so for how much. You can contact me privately (try6767 at gmail.com) to discuss it further.
You should use the Acrobat Pro "Split" feature in an Action (Action Wizard) or in a Custom Command.
This is possible when there are bookmarks in the file.
Sorry, I misunderstood the question.
I just recently wrote a script that parses the TOC out of a PDF and builds a set of matching bookmarks. In the past I've also written a plug-in, in which part of it's functionality was to find and read a TOC. There were several issues with this process.
Message me if you would like some consulting/development on this topic.
The file format is consistent and the start page numbers are written in front of the title ( right hand side of the document) in numeric format. The length of TOC changes though. I have developed a python script which can split the document; however, I need to do it in Acrobat JavaScipt so that the same can be added to the Actions of Acrobat.
Well then, all you need to parse the bookmarks and detect the page numbers is the "this.getPageNthWord" and "this.getPageNthWordQuad" functions. These give you the word and the words location on the page. Be warned, words are not necessarily returned in the order they appear on the page. Usually they do, but not always. I always sort the words into lines, and then order the lines.
Here's the SDK reference for the functions: