I did not understand what exactly I have to do in Calibre. Or you mean I have to edit the PDF file?
I tried to look for code in ePub file - there is a possibilite in calibre to open it in ePub-viewer and see the html-code. But I did not found any possibility to flip it back.
Could you describe the process more precise? For dummies...