2

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.

2 Answers 2

3

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:

  1. Convert the original document to .rtf format and save it as a new document.

  2. Edit the .rtf document in LibreOffice Writer to make it ".epub friendly".

    • Unindented margins should be changed to 0. You can, however, indent numbered or bulleted lists.
    • Paragraph indents, except for lists, should be changed to 0.
    • All lines should be single space.
    • All fonts should be 12 pt. except for headings.
    • All text should be the default style. Don't use any other text styles except for default.
    • Optional: Convert blank paragraphs to linefeeds to improve the readability of the epub document. In Writer -> Edit -> Find & Replace replace all instances of the regular expression ^$ by BLANK_PARAGRAPH and then with Alternative Search and Replace for Writer extension replace all instances of BLANK_PARAGRAPH by \n
  3. 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.

1

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.

4
  • 2
    Calibre is a powerful tool for that (I use it for years, mostly from the command line). And it can convert much more than just ODF, and even create good TOCs. You can also refer to other Calibre recommendations on our site for details.
    – Izzy
    Commented Oct 13, 2017 at 6:45
  • 1
    LibreOffice without any plugins in fact works perfectly for converting rtf to epub. I use a set of instructions for preparing the rtf file for conversion to an epub file that I wrote myself by trial and error. This results in an epub file that looks exactly the way I want for reading it in Calibre on my computer.
    – karel
    Commented Oct 13, 2017 at 7:44
  • Once you have a basic ePUB, you may want to tweak it with Sigil...
    – anarcat
    Commented Oct 25, 2017 at 0:25
  • I came here to post a Calibre answer, but am beaten to it. For eBook management, or format conversion, I do not believe that there is anything better
    – Mawg
    Commented Dec 14, 2017 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.