简体   繁体   中英

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

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

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

Another option is using the following after installing calibre .

ebook-convert  input.html output.epub

I found some break lines errors with pandoc, that didn't happen with ebook-convert

Source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM