There's quite a bit of manual tweaking involved, but if you want to create an xhtml file from a PDF, and be able to trim out things like headers and footers, and have some control over how it guesses when and when not to re-join lines of text, check out "pdfreflow" here:
https://www.mobileread.com/forums/showthread.php?t=83094
It isn't automatic, and it WILL take some learning, but when it works, it works well in my experience.
Also, don't know if it was made clear above, but MobiPocket Creator can use PDF directly as an input file. The results may not be any better than calibre (which IMHO does a reasonable job with the right parameter tweaks, especially the current versions).