@sealbeater. I'm very familiar with the problems involved in converting pdf to intermediate formats and epub, as I spent a little time on it some years ago before concluding it was simply not worth the effort in most cases. I'm quite familiar with all of the tools you are talking about. What you describe is a manual process of using these tools. Using sed to remove headers and footers is easy enough manually. But, as you should know, there is a world of difference between using these tools manually on a case by case basis, and incorporating their use into an effective "one size fits all" script.
You seem to have sufficient skills to accomplish the former but not the latter, despite your apparent high opinion of your skills and your apparent assumption that the rest of us don't have any. I look forward to seeing a working script from you, failing which:
A man of words and not of deeds
Is like a garden full of weeds