Hi. I've been needing to work with PDF TOC's, and for my sanity have written a script to automate much of the work. Thought you might be interested! https://github.com/Boruch-Baum/pdf-toc