http://madphilosopher.ca/2006/09/how-to-convert-chm-files-under-linux/
How to convert CHM files under Linux
September 24th, 2006
CHM files, known as Microsoft Compressed HTML Help files, are a common format for eBooks and online documentation. They are basically a collection of HTML files stored in a compressed archive with the added benefit of an index.
Under Linux, you can view a CHM file with the xchm viewer. But sometimes that’s not enough. Suppose you want to edit, republish, or convert the CHM file into another format such as the Plucker eBook format for viewing on your Palm. To do so, you first need to extract the original HTML files from the CHM archive.
This can be done with the CHMLIB (CHM library) and its included helper application extract_chmLib.
In Debian or Ubuntu:
$ sudo apt-get install libchm-bin
$ extract_chmLib book.chm outdir
where book.chm is the path to your CHM file and outdir is a new directory that will be created to contain the HTML extracted from the CHM file.
In other Linuxes, you can install it from source. First download the libchm source archive from the above website. I couldn’t get the extract_chmLib utility to compile under the latest version 0.38, so I used version 0.35 instead.
$ tar xzf chmlib-0.35.tgz
$ cd chmlib-0.35/
$ ./configure
$ make
$ make install
$ make examples
After doing the “make examples“, you will have an executable extract_chmLib in your current directory. Here is an example of running the command with no arguments and the output it produces:
$ ./extract_chmLib
usage: ./extract_chmLib <chmfile> <outdir>
After running the utility to extract the HTML files from your CHM file, the extracted files will appear in <outdir>. There won’t be an “index.html” file, unfortunately. So you’ll have to inspect the filenames and/or their contents to find the appropriate main page or Table of Contents.
Now the HTML is yours to enjoy!
==================================================================
Extract and decompile .chm file to view as html file under Linux
http://www.cyberciti.biz/tips/decompile-chm-file-to-view-as-html.html
You can view .chm file using gnochm or kchmviewer under Linux. However sometime you cannot install these programs. There is a third alternative - arCHMage.
From the man page:
arCHMage is an extensible reader and decompiler for files in the CHM format. This is the format used by Microsoft HTML Help, and is also known as Compiled HTML. arCHMage is based on python-chm binding to chmlib from GnoCHM project.
It allows you extract .chm to directory.
Step # 1: Use apt-get command
If you are using Debian / Ubuntu, type the command:
# apt-get install archmage
Step # 2: Extract .chm to directory (directory will be created):
Type the command:
$ archmage file.chm output
Open your browser and type url file:///home/you/output or file:///home/you/output/index.html
Other usage
You can view chm file using inbuilt http-server.
View chm file using Webserver
You can run archmage as http-server, which will publish chm file contents on specified port:
# archmage -p 8888 /path/to/file.chm &
Open a browser and type ulr http://localhost:8888/ or http://server-ip:8888/
Force apache to publish chm files
You can force Apache to publish chm file contents if there is trailing slash in request to that file. First make sure you have working mod_python. Now open httpd.conf /apache2.conf file:
# vi httpd.conf
Add following lines to your httpd.conf:
AddHandler python-program .chm
PythonHandler archmod.mod_chm
Save and close the file. Restart apache.
# /etc/init.d/httpd restart
Now upload file.chm to document root of your Apache webserver. Now view file by typing URL: http://you.com/file.chm/
Note: trailing slash at the end of URL.
Download arCHMage
=> Download arCHMage
https://sourceforge.net/project/showfiles.php?group_id=84745
分享到:
相关推荐
Linux中文HOWTO Linux中文HOWTO Linux中文HOWTO
这个是合集~一般是这里最全的了 另外加的 PDF是英文的 .为 GCC4.1的HOWTO <br>目录 <br>ADSM-Backup-html<br>Advocacy<br>Automount-html<br>Battery-Powered-html<br>BootPrompt-HOWTO<br>Bridge-......
Linux HOWTO(中文版) BootPrompt-HOWTO (28KB) 启动提示说明 CDROM-HOWTO (27KB) 如何安装, 设定及使用光驱,同时列出支援的硬体. Chinese-HOWTO (39KB) 如何在 Linux 的系统上使用中文?/TD> Config-...
how to convert PDF into WORD doc
介绍LINUX 下PCI的接口驱动编程 Linux PCI−HOWTO by Michael Will, Michael.Will@student.uni−tuebingen.de
linux高级路由和流量控制HOWTO中文版(牛老师译)
How-to-Use-SAMA5D2-GPIO-Under-Linux-00003293a.pdf
Linux Howto 中文版完整版.zip
Linux HOWTO 中文版(全) Linux HOWTO 中文版(全) Linux HOWTO 中文版(全)
Linux硬盘安装 用 wingrub 引导Linux安装详述
Linux Assembly HOWTO
How to Build a Ubuntu Linux host under VirtualBox
This project is a demonstration of how to convert a recordset into an XML format file. Its well documented and more XML stuff to come along.
NULL 博文链接:https://long316.iteye.com/blog/1393870
# VMS to Linux HOWTO, by Guido Gonzato <guido@ibogfs.cineca.it>. 如何从 VMS 转移到 Linux。 Updated 17 September 1999. # WWW HOWTO, by Wayne Leister <n3mtr@qis.net>. 如何建立 WWW 客户端及伺服器。 ...
Chinese-Linux-HOWTO,源码级的深度
linux howto系列教程
Linux Bible(2007 Edition)
Linux下的IPv6 Howto文档。
How to get access to a Linux server if you don't already. What a Linux distribution is and which one to choose. What software is needed to connect to Linux from Mac and Windows computers. ...