I am looking for a good open source tool to create EPUB files from ODT or PDF files.
It needs to run on Windows and Linux as well as be open source.
LibreOffice 6 can natively convert .odt and .pdf files to .epub format without needing to install any plugins in LibreOffice Writer. LibreOffice is open source and cross platform (Windows/Mac/Linux).
If you want more granular control over the formatting of the .epub document:
Convert the original document to .rtf format and save it as a new document.
Edit the .rtf document in LibreOffice Writer to make it ".epub friendly".
^$
by BLANK_PARAGRAPH
and then with Alternative Search and Replace for Writer extension replace all instances of BLANK_PARAGRAPH
by \n
Convert it to .epub from the command line with the Calibre application's ebook-convert
command.
ebook-convert input_file.rtf output_file.epub --cover COVER-FILE-LOCATION --remove-paragraph-spacing --chapter-mark none --flow-size 100
This command gives very nice results, but I think most people will be happier if they use LibreOffice Writer to do the document conversion instead of doing it the hard way with Calibre's command line tool.
After some searching I found that there is a libreoffice plugin for this but it seems a little unsupported.
After some more searching I found that Calibre can be used to convert odt files to epub which seems to work well enough.