How to create a CHM file using java?

I plan to write a utility for me that will take a directory containing html files, and then based on these html files will create a CHM file [Microsoft Compiled HTML Help].
So is there a free library for creating a CHM file? If not, please provide some guides or links for a basic understanding of how to create a CHM file.

+4
source share
2 answers

The “easiest” way to create a CHM file is to use Microsoft's “HTML Workshop” .

Basically, an “HTML Workshop” is a .exe file (hhc.exe) that compiles the specified HTML, CSS, and JS folder structure into a single .chm file that is no longer being edited.

So, in your case, when you want to create a .chm file in java, you need to save your HTML, JS and CSS sources in the correct structure for hhc.exe (see the "Workshop HTML" documentation on how this structure should look) .

Once this is done, copy the hhc.exe file from its installation directory to the HTML source folder and run it. This can be achieved by calling the batch script application from your java application, which can be achieved with the following code:

Process p = Runtime.getRuntime().exec("host call mySuperCoolBatchScript.bat); p.waitFor(); 

Once the compilation process is complete, delete the previously copied hhc.exe file from the original HTML folder and execute.

I hope this helps, let me know if you have any questions.

0
source

From the javadoc link in chm format , the Franck Allimant site seems to have two scenarios for generating chm from javadoc:

Although I do not like a snake, I would advise you to use a Python script, since it is easier to insert into the build process (read in maven or ant)

-2
source

All Articles