PDF's don't have tags or anything, so you cant really hope for that to be reliably be converted.
You might want to try importing the XPS version of the book into Word (I'm not sure if Writer has an XPS plugin) you might at least then be able to preserve fonts and most formatting - and export back out as html.
At best with the PDF, I'd say that saving the file out to text and working from there(it preserved indentation of code blocks when I saved it as text from Sumatra) - shouldn't be too tricky to scroll through mark the file up with some basic text for easier editing(since you don't want to run regex over the code/eq's). Strip the header/footer and eventually use regex to unwrap most of the paragraph text. From there throwing it into something like Sigil and mark the rest of it up.