>While I prefer open-source solutions, if you already have a recent version of MS Office, try loading your PDF directly into MS Word. MS Word now converts PDF files to Word documents amazingly well (another example here). Microsoft refers to this as PDF Reflow, and it has been available since MS Word 2013. Word's PDF Reflow even automatically finds the text in scanned/bitmapped PDFs and uses (quite accurate) optical character recognition (OCR) to convert it to editable text characters in the Word document. Once you have your PDF file in MS Word format, you'll have a lot more capability to manipulate it into other formats and/or form factors. For example, you can use the free e-book management utility, calibre, to convert .docx to epub/mobi, or you could use Writer2ePub, ePub Tools–a Word add-in, or pandoc (cross platform).
Holy shit, this works much better than the standard process with k2opt. Just open the pdf in word, save as docx and then use calibre to convert it to epub or azw3. You can then also edit the table of contents in calibre.