Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert HTML files to epub files programmatically ( command line ubuntu )

Tags:

Is it possible to convert a HTML5 file or text to epub file via a unix command line ? Is it possible to automate this process ??

thanks

like image 438
badaboum Avatar asked Feb 07 '14 11:02

badaboum


People also ask

How do I convert HTML to EPUB?

Procedure is very easy, download Sigil, then add your html files to sigil and save as epub. The key to the conversion is to remove everything but the main part of the chapter from the HTML files when adding html to sigl. Don't forget that.

How to extract text from EPUB file?

epub2html is a simple command-line utility for extracting text from EPUB documents and, optionally, re-flowing it to fit a text display of a particular number of columns. It is written entirely in ANSI-standard C. Show activity on this post. MuPDF can convert from epub to html and txt .

How to convert HTML to EPUB sigil?

After trying calibre extensively, you can have a try to convert html to epub sigil. All you have to do is just throw your html files (it automatically imports images referenced by them) and add some metadata. Procedure is very easy, download Sigil, then add your html files to sigil and save as epub.

What is epub2html?

epub2html is a simple command-line utility for extracting text from EPUB documents and, optionally, re-flowing it to fit a text display of a particular number of columns. It is written entirely in ANSI-standard C.


1 Answers

You can try pandoc

sudo apt-get install pandoc pandoc -f html -t epub3 -o output.epub input.html 

You can add metadata for epub:

pandoc -f html -t epub3 --epub-metadata=metadata.xml -o output.epub input.html 

Metadata xml file: metadata.xml

like image 141
mkjasinski Avatar answered Sep 30 '22 12:09

mkjasinski