@matrix It's the shittiest way to store anything and everything.
You can try to use Amazon's document converter to turn pdfs into azw3, which you can then turn into epub via Calibre. It's gonna take some time to set up the Amazon thing, but it gives better results than anything else I've tried.
epub and mobi and the most common you'll find. Sometimes azw3. But if for some reason you need epub exactly, you can use Calibre to convert.