Hi Raghav,
I tried converting the PDF to EPUB via calibre and the result was awful. Formatting got messed up. So I thought it would be better if the epub was generated directly from source?
Did you try converting the HTML version to EPUB? Calibre does that as well. EPUB is little more than a packaging convention for a subset of HTML, so this conversion is easier than starting from PDF.
Cheers, Konrad.