EPUB/Converting ODF to EPUB

From The Document Foundation Wiki < EPUB TDF (http://www.documentfoundation.org/) LibreOffice (http://www.libreoffice.org/) Community Blogs (http://planet.documentfoundation.org/) Pootle (https://translations.documentfoundation.org/) Moztrap (http://manual-test.libreoffice.org /) ODFAuthors (http://www.odfauthors.org/libreoffice/english/) Owncloud (https://owncloud.documentfoundation.org/common) Redmine (https://redmine.documentfoundation.org) Box (http://www.libreofficebox.org/) Ask LibreOffice (http://ask.libreoffice.org) | Donate (https://donate.libreoffice.org//)

Home Libraries Samples Badges Contact Wiki Help

EN AN AR AST BE BG BN BRX CA CA-VAL CS DA DE EL EO ES FA FI FR GD GL HE HI HU ID IS IT JA JV KO LO-LA LT MN MR NL NO OC OM PA PT PT-BR RO RU SAH SK SL SQ SV TA TE ไทย (TH) TR UK VI 正體 (ZH-TW) 简体 (ZH-CN)

This page discusses the process of Converting ODF to EPUB .

Contents

1 Which Formats? 2 EPUB Support in LibreOffice 3 Tools 4 Best Practices for Conversion 5 Links

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

In LibreOffice, there's currently an enhancement request: tdf#33226 (https://bugs.documentfoundation.org/show_bug.cgi?id=33226) - [FILEOPEN/FILESAVE] EPUB Documents . If that support is implemented, export directly from LibreOffice will probably become the best method for ODT to EPUB conversion.

In the meantime, there are multiple tools that produce EPUB output...

Tools Tool Version Test Input Test Output Testing Notes General Notes

Warnings about many not-supported styles No header, so no LO 4.2.3.2 + TOC v4.2 - Introducing FAILURE. Writer2ePub Failed with Error LibreOffice chapter No Output 1.1.25 423: Property or method not found: CLSID. In Module: Graphics - At line : 273

Warnings about many not-supported styles LibreOffice + Writer2ePub No header, so no extension (http://lukesblog.it/ebooks TOC /ebook-tools/writer2epub/) v4.2 - Introducing FAILURE. Failed with Error LibreOffice chapter No Output 423: Property or method not found: CLSID. In Module: LO 4.1.2.2 + Graphics - At Writer2ePub line : 273 1.1.25

Warnings about many not-supported styles FAILURE. Failed with Error Media:Regressions.odt No Output 91: Object variable not set. In Module: Graphics - At line : 133

Tool Version Test Input Test Output Testing Notes General Notes

Warning: (would not let me proceed) "Please structure your document by headings. You Output looks quite good. need at least one heading. To do Some so, put the cursor indentation/document into the first line structure appears to be LO 4.2.3.2 + v4.2 - Introducing EPUB output of your better than eLAIX 4.0.3 LibreOffice chapter document and ODT->EPUB click on "Format Button on toolbar says as Heading 1" in "Export EPUP [sic] the eLAIX Document..." Toolbar." LibreOffice + eLAIX extension After heading (http://elaix.org/releases.html) added per (EPUB 3) instructions, export was successful

Output looks quite good. Warning: (would Similar to 4.0.3 release not let me proceed) "Please Specific bugs with the structure your export: document by LO 4.2.3.2 + v4.2 - Introducing headings. You Title page is eLAIX EPUB output LibreOffice chapter need at least one missing (same in 4.1.0-2014-04-13 heading. To do eLAIX 4.0.3) so, put the cursor Bulleted points are into the first line not converting of your properly (See document and "Using the Save As command above, select..." and "To activate it:") Headings such as "Minimum requirements" lose their green color Tables sometimes break across in EPUB. Switching to "flow mode" (e.g. in Calibre's - viewer) helps to alleviate this problem. Content aligned by characters (e.g. "Jean Hollis click on "Format Weber as Heading 1" in Peter Schofield") is the eLAIX squished together Toolbar." after export After heading This might be added per a instructions, consequence export was of how tabs successful appear in HTML Missing table border/stroke around images such as "Figure 3: Example of tearing...") The Undo/Redo button images (e.g. the icon immediately following the first "Undo icon" in the text) are inline (Anchor -> As Character) in the ODT, but sit above the line of text in the export.

Harry Boldt, author of File:GS4201- File:GS4201- eLAIX, provided a IntroducingLibreOffice- IntroducingLibreOffice- modified ODT that is HB.odt - With Boldt's HB. more easily converted to tweaks EPUB

To convert TABS -> TABLES 1. Make sure there's a blank line between each line containing tabs 2. Select all the lines, then EPUB (read: HTML) Table -> File:GS4201- File:GS4201- doesn't handle tabs Convert -> IntroducingLibreOffice-HB IntroducingLibreOffice- properly, so I replaced Text to table tabs-to-tables.odt HB-tabs2tables.epub tab-aligned formatting -> OK w/tables 3. Now remove the extra vertical spacing by deleting the extra line in the cells on the RIGHT 4. Click inside the table, then Table -> Table Properties 5. Table Format -> Borders -> Line arrangement -> Default -> (Click) Set No Borders 6. (Also in Borders) go to 'Spacing to contents' -> (Set 'Top' and 'Bottom' to 0.00") To find the TABS in the first place 1. CTRL + F to find, then click on the Magnifying glass 2. Other Options -> (Select) Regular Expressions 3. Then Search For "\t"

Tool Version Test Input Test Output Testing Notes General Notes Good output, competitive with eLAIX. v4.2 - Introducing Calibre (ODT -> EPUB) Calibre 1.9 EPUB output LibreOffice chapter Preserves green header color (eLAIX does not)

Poor results, no where File:GS4201- Calibre: PDF -> EPUB Calibre 1.9 EPUB output near as good as the IntroducingLibreOffice. eLAIX 4.0.3 output. Tool Version Test Input Test Output Testing Notes General Notes Support for HTML5 and EPUB (3.0) not yet Use Extension implemented. Renders Manager to good document structure install the and TOC from headers, Writer2xhtml.oxt but some graphics are not Export and use incorporated into the LibreOffice + Writer2XHTML Writer2LaTex "Save as type" EPUB rendering. Installs v4.2 - Introducing extension 1.2 beta EPUB output dropdown select and functions as export LibreOffice chapter (http://writer2latex.sourceforge.net/) (2012-03-13) "EPUB (.epub) filter on all LibreOffice (*.epub)" builds through support for JRE 4.3.0alpha+ builds of must be enabled master. Primary focus of (tested with JRE Writer2LaTex project is 7u51) 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:

Caption
.

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 CSS.

Links

EPUB (https://en.wikipedia.org/wiki/EPUB)

Retrieved from "https://wiki.documentfoundation.org/index.php?title=EPUB/Converting_ODF_to_EPUB&oldid=108049"

Category: EN

EN > Main > Languages > EN

This page was last modified 13:49:01, 2015-01-25 by Dennis Roczek. Based on work by Robinson Tryon and The Document Foundation Wiki user Dennisroczek. Please note that all contributions to The Document Foundation Wiki are considered to be released under the [http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike 3.0 Unported License], unless otherwise specified. This does not include the source code of LibreOffice, which is licensed under the GNU Lesser General Public License ([http://www.libreoffice.org/download/license/ LGPLv3]). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our [[TradeMark Policy|trademark policy]] (see [[Project:Copyrights]] for details). LibreOffice was based on OpenOffice.org. If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.