You know I had read so many bad reports at how calibre converts pdfs I hadn't tried it but Mostly Maths comment made me get of my backside. The result is that it converted each page as a chapter which although now fragmented I think you could just cut and paste the code in an editor. I've played a bit with sigil and I think that would work. Although I'd need to learn how to fly the sigil toc editor. I couldn't reproduce the instruction manual's advise but I'm sure it can be done with the right instruction.
It added all the pics, kept the headers and footers

and the tables are a mess.

Though I've seen a lot worse conversion out of acrobat.
You learn something new here every day.
Thanks MostlyMath.
@AshleyWilis which converter? I was using EXPORT