12

I have html files/Directories, I want to convert them to .chm help file, under Linux using command lines at Terminal?

Any help would be appreciated.

ama
  • 371
  • 4
  • 13

3 Answers3

10

The Free Pascal compiler, version 2.4.4 or higher has a CHM compiler for *nix called "chmcmd". I would recommend getting it from version 2.6.0. It works on MSHelp .hhp project files.

The compiler is also available in source (styled like a classes library), so you could roll your own. It is crossplatform, but Big Endian platforms are not tested very well.

2.6.0 is from januari 1st 2012, so you might need to get it from a "bleeding edge" packages repository of your distribution.

Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89
  • after downloading and installing Pascal compiler on linux pc ,what i should do now ,how to use it? – ama Feb 07 '12 at 13:25
  • As said just chmcmd project file. Search on the web how to craft a hpp file, it is the same as the workshop format. – Marco van de Voort Feb 07 '12 at 15:42
  • i have tried this chmcmd filename.hhp this file contains names of html files to include in chm file ,but some of them is listed in directories ,so this command give me : Warning: File directoryName\fileName.html does not exist for each file placed in directory even for images and css files – ama Feb 08 '12 at 11:46
  • maybe a / vs \ problem ? Try replacing all \'s to /'s and try again – Marco van de Voort Feb 08 '12 at 11:53
  • yes thnx that was the problem , but after opening the chm file and goes to contents tab and click over the headers inside directories the pages does not opened – ama Feb 08 '12 at 12:07
  • You don't need to install the whole Free Pascal compiler. `chmcmd` utility resides in `fp-utils` package and can be installed just by `sudo apt-get install fp-utils` (at least on Ubuntu 14.04.4). – flaz14 Jul 10 '16 at 10:33
  • 1
    (the division into packages is something distribution specific) – Marco van de Voort Jul 10 '16 at 16:50
  • if I have .html then how I can convert it to .chm – erdarshp Jul 11 '18 at 14:35
  • Write a HHP project for it, and compile with chmcmd or the mshelp compiler. – Marco van de Voort Jul 11 '18 at 14:46
  • I have to do it on Linux Ubuntu 14.04, I need to automate this process. Is it possible? – erdarshp Jul 12 '18 at 05:44
  • I guess so, you could use a template .hhp and then fix the names with awk or tr or so and then compile with chmcmd – Marco van de Voort Jul 12 '18 at 07:48
  • As you suggested I tried to convert .hhp to chm using chmcmd. getting below error An unhandled exception occurred at $0000000000405A6A : EFCreateError : Unable to create file "" $0000000000405A6A $0000000000401083 $00000000004005E6 ### This how my .hhp file looks like [OPTIONS] [FILES] /home/jenkins/Elina_Doc_Generated/Service.fidl.net.connman_Service.html – erdarshp Jul 16 '18 at 08:45
  • Seems your shell has no writepermissions in the curent directory – Marco van de Voort Jul 16 '18 at 13:30
  • it has the write permission, and i have tried as root user. still facing the same issue. – erdarshp Jul 17 '18 at 06:57
3

CHM is a proprietary Microsoft format, so keep in mind most Open Source tools will likely be focused on reading and converting chm to html . if you want to create CHM file on Linux then you will need a CHM compiler that you can use with wine . details are on the following link Compiling_CHM_help_files_in_Linux_with_HHC_and_Wine

raj_gt1
  • 4,653
  • 2
  • 20
  • 28
  • how i can use it, under linux?exe file does not open on linux – ama Feb 07 '12 at 10:36
  • first install `wine` on linux. using `wine` you can open some supported `.exe` files on linux. provided `chm compiler` is one of them. – raj_gt1 Feb 07 '12 at 10:44
  • see if this link can help you .i have not used it but this claims to work on linux. http://linux.softpedia.com/progDownload/Rahman-CHM-Maker-Download-45103.html – raj_gt1 Feb 07 '12 at 10:48
  • how these applications would help me in creating the chm file through terminal – ama Feb 07 '12 at 12:22
  • please go through the README.txt file of tool. – raj_gt1 Feb 08 '12 at 10:46
  • raj_gt: that tool seems to be based on older chmcmd versions. Homepage is MIA. Ms Htmlhelp workshop via Wine is an option though – Marco van de Voort Oct 23 '18 at 12:09
-2

You can do that with libchm, you find it http://www.jedrea.com/chmlib/ .

It contains extract_chmLib, which extracts html pages from the help pages to a directory.

Jörg Beyer
  • 3,631
  • 21
  • 35