Agreed, it is very slow, but also very effective, so I ended up using this code at the time the PDF is uploaded via my CMS. The result is then stored in the database along with all the other data about the file. Should circumvent any speed/load issues.