- Calibre, great software, but not for conversion to PDF: it doesn't handle top and bottom margins on this type of conversion, so it even cuts characters in half on the output PDF between pages
- Printing from the Calibre Ebook-viewer to PDF file: works in some ways better than the Calibre conversion itself, but it doesn't handle page breaks
- CLI (command line interface) use of Calibre's conversion (ebook-convert): works, but I can't manage the parameters well enough from the command line
The workflow is:
- make a copy of your .epub file
- rename the extension of your copy from .epub to .zip (it is in fact a simple .zip file)
- extract the .zip file in a directory of your choice
- navigate to the subdirectory where the text files of your ebook are extracted (the .html and .xhtml ones)
- use the command
prince cover.xhtml page_1.html page_2.html page_3.html -o book.pdf
where you change and add filenames according to your specific case of course.
(With thanks to this thread...)