`
wutao8818
  • 浏览: 616261 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

How to convert CHM files under Linux

阅读更多
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 Linux中文HOWTO

    linux howto中文合集

    这个是合集~一般是这里最全的了 另外加的 PDF是英文的 .为 GCC4.1的HOWTO &lt;br&gt;目录 &lt;br&gt;ADSM-Backup-html&lt;br&gt;Advocacy&lt;br&gt;Automount-html&lt;br&gt;Battery-Powered-html&lt;br&gt;BootPrompt-HOWTO&lt;br&gt;Bridge-......

    Linux Howto 中文文档

    Linux HOWTO(中文版) BootPrompt-HOWTO (28KB) 启动提示说明 CDROM-HOWTO (27KB) 如何安装, 设定及使用光驱,同时列出支援的硬体. Chinese-HOWTO (39KB) 如何在 Linux 的系统上使用中文?/TD&gt; Config-...

    Linux PCI how to

    在《Linux PCI HOWTO》文档中,作者迈克尔·威尔(Michael Will)详细介绍了Linux环境下PCI接口的驱动编程技术。PCI(Peripheral Component Interconnect)即外围部件互连标准,是计算机中常用的一种总线标准。该...

    Chinese-Linux-HOWTO

    《Chinese-Linux-HOWTO》是一份详细的指南,专注于在中文环境下配置和使用Linux操作系统。这份文档深入到源码级别,旨在帮助用户理解和解决在安装、配置和使用中文Linux时遇到的各种问题。它不仅适用于初学者,也对...

    AN_3293-How-to-Use-SAMA5D2-GPIO-Under-Linux-00003293a.pdf

    How-to-Use-SAMA5D2-GPIO-Under-Linux-00003293a.pdf

    Linux Howto 中文版完整版.zip

    Linux Howto 中文版完整版.zip

    Linux HOWTO 中文版(全)

    Linux HOWTO 中文版(全) Linux HOWTO 中文版(全) Linux HOWTO 中文版(全)

    linux howto系列教程

    Linux Howto系列教程是针对Linux操作系统的一套详细学习资料,旨在帮助用户从基础到进阶全面掌握Linux系统操作、管理及应用。这个教程涵盖了Linux系统的各个方面,包括安装、配置、命令行操作、文件系统管理、网络...

    linux高级路由和流量控制HOWTO中文版(牛老师译)

    这篇文档“Linux高级路由和流量控制HOWTO中文版”由牛老师翻译,为读者提供了深入理解这些概念的宝贵资源。以下是对其中核心知识点的详细解读: 1. **基本路由**:在Linux中,路由是指指导数据包通过网络到达目的地...

    This project is a demonstration of how to convert a recordse

    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.

    最新的linux howto 中文合集

    # VMS to Linux HOWTO, by Guido Gonzato &lt;guido@ibogfs.cineca.it&gt;. 如何从 VMS 转移到 Linux。 Updated 17 September 1999. # WWW HOWTO, by Wayne Leister &lt;n3mtr@qis.net&gt;. 如何建立 WWW 客户端及伺服器。 ...

    How to use linux

    Linux,作为一个开源、免费的操作系统,自诞生以来就受...通过阅读《Linux Bible(2007 Edition)》和《LPI Linux Certification in a Nutshell.chm》,你可以逐步深入这个充满魅力的开源世界,成为一名熟练的Linux用户。

    Linux HOWTO 中文版

    Linux HOWTO 中文版是一份全面的指南,旨在帮助初学者和有经验的用户更好地理解和操作Linux操作系统。这份文档详细地介绍了Linux系统的基础知识、安装过程、常用命令、系统管理以及一些高级主题。以下是这份资源中...

    Linux for Beginners: An Introduction to the Linux Operating System

    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. ...

    how-to-learn-linux.zip_Howto Linux学习

    本文将基于"how-to-learn-linux.zip_Howto Linux学习"的资源,深入探讨Linux学习的路线,帮助你从入门到精通,提升你的技能。 一、Linux基础 Linux的学习始于了解它的基本概念。Linux是一种自由和开放源码的操作...

    Linux How To

    "Linux How To"通常是指一系列针对Linux操作系统的教程或指南,旨在帮助用户更好地理解和使用这个平台。这里列出的压缩包文件包含了多个主题的HOWTO文档,都是关于Linux特定领域的详细指南。 1. **PPP-HOWTO-...

    linux-how-to手册

    Linux "how-to"手册是一系列详细的指南,专为Linux用户和管理员提供操作步骤和技术说明。这些手册涵盖了Linux系统中的各种主题,旨在帮助用户理解和解决特定问题。以下是对压缩包文件中部分子文件名称的解释,以及...

    Linux DRM how-to 例子

    在“Linux DRM how-to”中,你可能会学习到如何配置DRM系统,编写libdrm驱动程序,调试图形问题,以及如何利用现有的开源工具进行测试。理解并掌握这些知识点对于从事Linux图形栈开发或系统优化的工程师来说至关重要...

Global site tag (gtag.js) - Google Analytics