Difference between revisions of "Convert a .docx file to EPUB with Calibre"

From Parallel Library Services
Jump to navigation Jump to search
Line 22: Line 22:
unzip demo.epub
unzip demo.epub
</syntaxhighlight>
</syntaxhighlight>
[[File:demo_epub_unzipped.png|300px]]


You'll now see that the EPUB is made of a collection of different files, mainly:
You'll now see that the EPUB is made of a collection of different files, mainly:

Revision as of 19:39, 16 November 2021

This tutorial has been adapted from instructions by Silvio Lorusso, published on the Institute of Network Cultures blog.

You can convert a .docx file directly into an EPUB using Calibre. For this, we will use the demo.docx file provided by the developers at Calibre:

http://calibre-ebook.com/downloads/demos/demo.docx

Add this file to your Calibre library either via the "add books" button, or by dragging and dropping the file into the Calibre interface.

Adding docx to Calibre.png

Click on the "Convert books" button, and choose EPUB as the destination (output) format.

Converting docx to EPUB Calibre.png

You will now see an EPUB format has been added to Calibre under the same listing. Open the EPUB in an e-reader to inspect it. Because we didn't specify a cover image, Calibre generated a default cover. The features of the .docx are largely preserved in the EPUB, minus some minor glitches:

Demo epub inside.png

We can look inside the EPUB by unzipping it. To do this, find the file demo.epub in your computer, and change the file extension from .epub to .zip, or on Mac, open a terminal session, and in the directory where the file demo.epub is, run the following command:

unzip demo.epub

Demo epub unzipped.png

You'll now see that the EPUB is made of a collection of different files, mainly:

  • mimetype
  • fonts folder - containing document fonts
  • META-INF folder
    • container.xml: tells the reader software where in the zip file to find the book.
  • OEBPS folder - books content (name can change)
    • images folder - images (PNG) go here (can be changed)
    • Content.opf - lists what's in the zip file
    • toc.ncx - Table of content
    • xhtml files - The book's contents are in these
    • CSS files