Converting .hlp files to .chm
Summary
Explains how to convert windows help files from the old .hlp format to the newer HTMLHELP format (.chm) by using the winhelpcgi program.Introduction
The .chm (htmlhelp) file format introducted with windows 98 has obsoleted the older .hlp (winhelp) file format for windows help authoring. However there are still a lot of applications using the older format for various reasons. One of the problems involved with the transition is the fact that after converting an existing source code for a .hlp file into a sourcecode for a .chm file a lot of details have to be reworked since the converter program shipped by Microsoft with their Html Help Workshop is of rather limited quality.We already addressed some of the problems involved with our older HTMLHELP tools which post-process the files created by Html Help Workshop to enhance their quality.
In winhelpcgi we have implemented a much better technology for the conversion of existing .hlp projects to .chm. It contains a technology we call tab-emulation to emulate the tabs missing in html publishing by using nested tables. It also uses CSS style sheets to represent the right formatting. In the end the resulting HTML files are of much higher quality than the ones created by Microsoft Html Help Workshop.
Winhelpcgi creates a CHM sourcecode that can either be compiled using Microsofts Html Workshop or be viewed by packing it with zip into a .htb file and viewing it with the

Requirements
You need:- Our winhelpcgi.cgi package in version 1.0rc1 or newer for your operating system.
- Some "tar" program. GNU
gnu "tar" is fine. I think some kind of tar is always installed on all current operating systems except Window$.
- Microsoft Html Workshop running on some Windows PC to compile the files.
Steps
- Install winhelpcgi.cgi
- Copy the .HLP file and the .CNT file (if you have one) into the directory where you installed winhelpcgi.cgi to.
- Change directory to this directory.
- Start winhelpcgi with parameter --tar and the relative filename of the .hlp file to convert.
- Redirect output of winhelpcgi.cgi
--tar to the tar program
to extract what you need.
Example
# Install winhelpcgi. Here for debian
apt-get install winhelpcgi libwmf
# Copy help file
cp -p myfile.hlp myfile.cnt /usr/lib/cgi-bin/
# Change directory
cd /usr/lib/cgi-bin
# Convert file
./winhelpcgi.cgi --tar myfile.hlp | tar -C /tmp --extract --verbose
This will create /tmp/myfile.hlp/ directory with a lot of subdirectories.
See also
- winhelpcgi project page
- winhelpcgi downloads
- Online example of using winhelpcgi for help file publishing
- Online publishing of windows help files.
Hilfedateien in HTML und HTMLHELP konvertieren
Print windows help files on Linux