I have some documents that are in a .chm
format.
I wondered if there is a file format that can be easier to navigate, supported and of equal file size in Ubuntu?
If there is, I would like to start converting all those books and probably using them with less hassle on all my Ubuntu PCs and my Android phone.
You can convert them to PDF using the command line program chm2pdf (install chm2pdf here). Once installed you can run the command from a terminal like this:
In case you didn't know, there are several chm readers available - just search
chm
in the Software Centre.You can also extract chm files to html using the command line tool 7-Zip (install p7zip-full here):
If you do not want to use PDF then I would suggest Epub, a fairly good, open e-book format, you can install a good reader for it called Calibre on Ubuntu, Calibre has a useful conversion facility that can import chm files and then convert them to other formats epub included. epubs can be easily read on most smart phones and tablets as well.
Calibre can be installed from the software center.
There is also KChmViewer, if you prefer KDE.
There is also xchm and a few chm readers on Android.
dv3500ea has a great chm2pdf answer, but I prefer to read them as html files.
In short:
Source: http://www.ubuntugeek.com/how-to-convert-chm-files-to-html-or-pdf-files.html
Then open up
./outdir/index.html
to view the converted html files! Yaaay! Much better. Now I can navigate it just like a .chm file, but I can also use my Chrome browser to search the pages for text, easily print, etc.Let's make a command called
chm2html
Here's a nice script I wrote.
chm2html.py
chmod +x chm2html.py
~/bin
directory if you don't already have one:mkdir ~/bin
~/bin
directory:ln -s ~/path/to/chm2html.py ~/bin/chm2html
source ~/.bashrc
chm2html myFile.chm
. This automatically converts the .chm file and places the .html files into a new folder called./myFile
, then it creates a symlink called./myFile_index.html
which points to./myFile/index.html
.chm2html.py
file: get the latest version of this file on GitHub here from my eRCaGuy_dotfiles repo:This is an old question, but a straight-forward answer is to use
archmage
which can host the chm contents as a website on localhost.For example run
archmage -p 5000 file.chm
and open http://localhost:5000 in your webbrowser to open the documentation inside the
chm
file.Manpage as reference:
http://manpages.ubuntu.com/manpages/trusty/man1/archmage.1.html
Wine is enough .
Then : Open it using this soft
Calibre will do it all
Install Calibre
import the chm file into Calibre with
Add books
buttonuse
Convert books
button to convert it to epub or pdf.