Automatically Split PDFs according to content

In order to handle the billing of my gliding club via our homepage instead of per snail mail, I need to split a long PDF (created by printing from our accounting program) into individual bills according to ID numbers on each page.
Individual bills can be one or more pages long.
The ID numbers must be contained in the filenames of the newly created PDFs for further handling.

Note: The text of the PDF is searchable, but I can’t find the strings if I just view the source.

Is there a function in Adobe Acrobat or an Add-In that can do that?
Is there a PHP library that can handle that (preferred option)?

Thanks for any pointers!

If you know shell scripting, you can do this fairly easily using your favourite shell plus the pdftotext and pdftk tools. I’d use pdftk’s “burst” function to chop up the original PDF into several PDF files (one per page). Then I’d loop through the pages, grepping the output of pdftotext to check for the presence of an ID number. If an ID number is found, then use pdftk to concatenate the previous pages into a single file.

why cant the accounting program print separate files?

keno - I’m not really familiar with the accounting program myself, but apparently it’s set up to print everything at once since it was built when you printed everything out and distributed it into envelopes. Of course yours would be the easiest way if it was possible.

psychonaut - that sounds good, though I’d prefer to do it with php on our webserver. It has pdflib version 4.0.3 installed, does anybody have any experience with that?