You will see that I have posted about this before asking for suggestions on which software I can use to convert PDF to docx/odt.
I am a teacher. During my time as a researcher I wrote a lot of documents and regularly draw upon them to teach my students. I often have to take the text, modify them, or build upon them. A lot of my material is bound up in PDFs. Sometimes, I have grant applications to write where a previous draft I wrote was stored as a PDF. Converting them to text has become the bane of my life.
I am forced to use online tools because none of the software I have seem to do the trick. Lot of people keep saying pandoc. Pandoc does not convert PDF to any other format. It can only be the output format.
Is there a magic open source solution that I have missed out?
Your question is like asking how to convert a cake into flour, sugar, milk, butter and (unbroken!) eggs.
The only real solution is to always keep your source files. PDFs are not intended to be edited.
There’s no any solution. It is impossible to convert from PDF to any editable format correctly. The exception is a “hybrid PDF” that has an embedded editable document. If you need to edit PDFs that you created yourself, store them in hybrid format.