Calibre on its own will convert between formats and there are plugins that will strip drm. I have no idea about the legality in various parts of the world but it is a solid solution for liberating content and making it portable
Yeah, but it can't usefully convert PDFs. To make a PDF usable on an e-reader you've got to trim the margins, and chop it into pages that exactly fit the e-reader screen (in landscape, due to line length issues)--and even then some just can't be converted. And in doing this you need software that knows where to cut pages and whether to insert padding so that lines don't get cut off. And you never want to use OCR or text extraction, which suck. It's an extremely difficult process, but since panning and zooming on ereaders is unusable it's the only way I've found that works (I use the k2pdfopt software)--the alternative is just using a tablet for PDFs which is what I increasingly do.
PDFs are already an open format and the software that you are looking for would take 5 billion dollars of research money to produce. Every PDF is formatted differently.
k2pdfopt, which is free, works for almost every PDF.