EPUB/Converting ODF to EPUB
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
This page discusses the process of Converting ODF to EPUB.
Which Formats?
There are many possible routes for converting ODF -> EPUB. In this section, we'll focus on the conversion of ODT -> EPUB, using (in general) tools that support ODF 1.2 and EPUB 3.
EPUB Support in LibreOffice
Since LibreOffice 6.0, it is possible to export from ODT to EPUB with
▸ ▸ . It is recommended to first try this option.The corresponding enhancement request in Bugzilla was ticket tdf#33226. Two blog posts discussing the implementation were published:
However, other tools exist.
Tools
Tool | Version | Test Input | Test Output | Testing Notes | General Notes |
---|---|---|---|---|---|
LibreOffice + Writer2ePub extension | LO 4.2.3.2 + Writer2ePub 1.1.25 | v4.2 - Introducing LibreOffice chapter | FAILURE. No Output |
|
|
LO 4.1.2.2 + Writer2ePub 1.1.25 | v4.2 - Introducing LibreOffice chapter | FAILURE. No Output |
|
||
Media:Regressions.odt | FAILURE. No Output |
|
|||
Tool | Version | Test Input | Test Output | Testing Notes | General Notes |
LibreOffice + eLAIX extension (EPUB 3) | LO 4.2.3.2 + eLAIX 4.0.3 | v4.2 - Introducing LibreOffice chapter | EPUB output |
|
Output looks quite good.
Some indentation/document structure appears to be better than Calibre ODT->EPUB |
LO 4.2.3.2 + eLAIX 4.1.0-2014-04-13 | v4.2 - Introducing LibreOffice chapter | EPUB output |
|
Output looks quite good. Similar to 4.0.3 release
Specific bugs with the export:
| |
File:GS4201-IntroducingLibreOffice-HB.odt - With Boldt's tweaks | File:GS4201-IntroducingLibreOffice-HB.epub | Harry Boldt, author of eLAIX, provided a modified ODT that is more easily converted to EPUB | |||
File:GS4201-IntroducingLibreOffice-HB tabs-to-tables.odt | File:GS4201-IntroducingLibreOffice-HB-tabs2tables.epub | EPUB (read: HTML) doesn't handle tabs properly, so I replaced tab-aligned formatting w/tables |
| ||
Tool | Version | Test Input | Test Output | Testing Notes | General Notes |
Calibre (ODT -> EPUB) | Calibre 1.9 | v4.2 - Introducing LibreOffice chapter | EPUB output | Good output, competitive with eLAIX.
Preserves green header color (eLAIX does not) | |
Calibre: PDF -> EPUB | Calibre 1.9 | File:GS4201-IntroducingLibreOffice.pdf | EPUB output | Poor results, no where near as good as the eLAIX 4.0.3 output. | |
Tool | Version | Test Input | Test Output | Testing Notes | General Notes |
LibreOffice + Writer2XHTML extension | Writer2LaTex 1.2 beta (2012-03-13) | v4.2 - Introducing LibreOffice chapter | EPUB output |
|
Support for HTML5 and EPUB (3.0) not yet implemented. Renders good document structure and TOC from headers, but some graphics are not incorporated into the EPUB rendering. Installs and functions as export filter on all LibreOffice builds through 4.3.0alpha+ builds of master. Primary focus of Writer2LaTex project is LaTex, EPUB support an off shoot of projects XHTML support. |
Best Practices for Conversion
Because of limitations in the conversion process, this section will contain a set of "Best Practices" that will help authors improve the ease with which their ODT documents may be converted to EPUB.
- eLAIX requires a heading (e.g. 'Heading 1') used in the document
- Tests have indicated that some converters do not correctly convert bulleted/numbered list styles; direct formatting may be preferable
Notes from Harry Boldt re: eLAIX conversion testing:
- Most problems however appeared, because eLAIX needs style names such as "Heading 1..4" for headings and "Illustration" for image captions. I know, it should be possible to use own style names everywhere. I will correct this in future versions.
- The title page: eLAIX starts reading from the first heading, what means, that all stuff placed before is not exported. Your title page is a good example, that this is not a good solution. So I will change the export in the way, that everything will be exported, regardless of the occurence of headings.
- Lists: eLAIX is assuming, that a new list starts, when the style is changing. In your document, you use "Start - Continue - End" styles for lists, what is a good practice. Unfortunately I wasn't aware of that. So I have to find a better solution here.
- Headings: As long as there is no better solution in eLAIX, please do not change the style name for headings. Leave them the way, LO generates it "Heading 1", "Heading 2" and so on. If you do so, the styling of your headings will be reflected in the ePUB.
- Table breaking across pages: I'll try to find a solution for avoiding page breaks, see http://www.pigsgourdsandwikis.com/2011/11/keeping-it-together-page-breaks-in.html.
- TABs in content: They are not supported so far. It's on the to do list.
- (Work-around: Use a table instead)
- Table border/strokes missing in Figure 3: Can you explain more detailed, what you mean? I can't see a border.
- Small graphics/icons: I have to test in more detail, why your small graphics an missplaced in the ePUB. If you click on the appropriate eLAIX toolbar button "Graphic Align Inline", they will be properly exported. What is then been done behind the scenes is: AnchorType=AsCharacter, HoriOrient=Left, TextWrap=None.
- Image Captions: It is really hard, to recognize an image caption in LO by macro. Internally, the caption is not saved as an image property. LO just generates a paragraph below the image. Therefore, in order to identify an image caption, eLAIX looks for the style "Illustration". Not the best solution, I know. Using the style "Illustration" for image captions will lead to the standard HTML5 construction: <figure><img src=".."><figcaption>Caption</figcaption></figure>.
- Use the character style "Standard" for general settings of your ePUB such as font-family, font-color, font-size, font-weight, text-decoration and text-align. Those settings will be generated as CSS rules for the body tag of the ePUB document. As long as these settings aren't overwritten by other paragraph settings, they will be inherited.
- eLAIX does not remove special characters like "/" and "." from styles at the present. So as long as this isn't fixed, do not use special characters for paragraph, frame or character styles, since they won't work in the ePUBs CSS.
Links
- EPUB