How in my code (Delphi) to make CHM files from a bunch of HTML (with linked image files)? Details needed, thanks!
3 Answers
The normal way to do this is to use hhc
from Microsoft's HTML Help Workshop to build a help project, specified in a .hhp
file. You can write the .hpp
file yourself, and all its auxiliary files. Or, more commonly, you can use a 3rd party help authoring tool of which there are many.
I don't see where Delphi comes into the building of the .chm
file, but if I've missed something then please update your question to add more details.

- 601,492
- 42
- 1,072
- 1,490
-
Documentation generation tools? – Marco van de Voort Jan 24 '11 at 11:28
-
@Marco I'm sorry, I don't follow your comment. – David Heffernan Jan 24 '11 at 11:29
-
Documentation tools written in Delphi are a valid application for a CHM generating library. I know because we did it because of that :) (in reply to your "don't see where Delphi comes into..") – Marco van de Voort Jan 24 '11 at 11:54
-
@Marco I still don't understand! I must be particularly slow today. – David Heffernan Jan 24 '11 at 11:57
-
@Marco OK, I think you mean that the OP may want to write his/her own help authoring tool and use Delphi code to generate the .chm file. And that's the crux of your answer. If it were me, I'd be inclined to shell out to `hhc` as do most of the professional packages, but that's obviously a personal preference. – David Heffernan Jan 24 '11 at 12:22
-
hhw afaik is not certified for Windows 7 deployment. If the documentation application is for internal use, no problem, but if you need to deploy, it is not so simple. That doesn't mean the below package is ideal, far from it, but there are multiple tradeoffs, and it is not a simple "by default" decision. Trust me, I worked on below app for a reason :-) – Marco van de Voort Jan 24 '11 at 13:08
-
@marco I'm using Flare on Windows 7 which relies on html help workshop. I don't perceive deployment to be an issue. – David Heffernan Jan 24 '11 at 13:30
-
It is not deploying yourself as experienced IT, but supporting deployment of your app with dependancies with sb else. As said, we mainly did it because our main servers are Linux. 64-bit even. But several users of the package commented on its use. – Marco van de Voort Jan 25 '11 at 07:51
Maybe there are libs/components to do that. Personnaly, I made it myself as it is quite easy.
Your application should
- list all files to include
- Create HHC + HHP + HHK files content-
- call command line hhc.exe with HHP parameter
As an example, have a look to DelphiCodeToDoc CHM generator.
Read uDocGenCHM_Tools.pas
and uDocGeneratorChm.pas
in svn repository of my project (too large to post here!).
https://dephicodetodoc.svn.sourceforge.net/svnroot/dephicodetodoc/trunk/DelphiCodeToDoc/Source/Generator/Chm/

- 4,879
- 1
- 32
- 56
-
-
I accept this answer because it provides example codes in Delphi. But other answers are great too! Thank you guys! – Edwin Yip Jan 29 '11 at 04:53
Free Pascal includes a CHM read/write library (without dependancies), and SVN versions also contain a basic commandline CHM compiler. The license is the same as the rest of FPC's Library, LGPL with static linking exception, so fine for commercial use.
I think it should be fairly easy to port to Delphi.
The somewhat outdate package page for this package is
http://wiki.freepascal.org/chm
The package was originally developed for FPC's library documentation tool fpdoc. (Documentation is generated nightly in some cases, and all FPC/Lazarus' servers are Unix)

- 25,628
- 5
- 56
- 89