I find it useful to convert ebooks in formats such as epub to PDF. This is useful for example to annotate or take notes, since those features are well supported for PDF files in a portable manner.
The best tool I have found to export ebook to PDF is the
ebook-convert tool in Calibre.
$ sudo apt install calibre
$ ebook-convert in.epub out.pdf $ ebook-convert in.epub out.pdf <other options go here>
--enable-heuristics to convert with formatting tweaks that make the resulting document nicer.
--pdf-page-numbers to add page numbers at the bottom of every page. This was also the only option that helped fix another problem I faced: last line of some pages would get split to the next page.
Tried with: Calibre 3.21.0 and Ubuntu 18.04