chmProcessor.
A Html / Word converter to Compiled HTML Help / Java
Help
chmProcessor is a tool that
allows generating a help project and a compiled HTML help (CHM
file) from a MS Word or HTML 4 file. If the file is a word
document, the section titles must use the “Title 1”, “Title 2”, etc
styles that offers by default Word. If the file is a HTML 4 file,
the titles must use the <H1>, <H2>, etc.
tags.
From this original file,
each section of the document is split to different HTML files. Each
of these files will be a topic page at the help. From the original
document, you can generate:
·
A Microsoft Help Workshop project.
·
A compiled HTML help (CHM file).
·
A web site like this.
·
An Adobe PDF file.
·
A Microsoft XPS file.
·
A Java Help JAR file.
Requirements
To use this program, you
must to have installed the following software:
- Microsoft
Windows. Tested versions: Windows
2000 (32 bits), Windows XP (32 bits), Windows 7 (32 and 64 bits).
Console interface will not work over windows 2000. Versions 1.4 and
earlier of chmProcessor do not work on 64 bits operating
systems.
- Internet Explorer 6 or
above.
- Microsoft .NET
Framework 2.0. You can download the
runtime version here:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=19
- HTML Help
Workshop. If you don’t have it,
you cannot compile the help, you can generate a web site only. You
can it download from here: http://msdn2.microsoft.com/en-us/library/ms669985.aspx
- Microsoft
Word if you will work with Word
files. Ms Word 2003 and 2007 has been tested.
Optionally, you can
generate PDF and XPS files. To generate a PDF, there is two ways:
Use PDFCreator or use the Microsoft Office 2007 Add-in to generate
PDF and XPS. The last one is the recommended. To generate a
XPS file, the MS Office 2007 Add-in is mandatory:
If you want to generate a
Java Help, you will need the following software:
If you are going to
generate CHM files with a character codepage different than your
system default, for example if you live on Spain and your help will
be written in Cyrillic, you will need this:
Limitations
- Versions 1.5 and older
will not work generating CHM files with source files with encodings
different than
Windows-1252. Version 1.6 and
higher should work. I need feedback about this topic. I have done
some tests, using AppLocale,
with Cyrillic and they seem to work. If you live
on a country where the Latin alphabet is not the standard (China,
Thailand, Russia, etc), please say me if it’s working on
my mail address at sourceforge or at the
bug
tracker.
- Not all
kind of documents will be well formatted,
especially HTML documents. Try to avoid put titles into tables, put
images with title styles, and such kind of things, because the
application will be confused about how to split and index the
document. Avoid Javascript.
- Keep in mind that if you
use more than one Word source files, the text styles used should be
equal on all documents. So, if some style is different on some
document, it can be overwritten by the definition of other
document.
- Only version 4 of HTML has
been tested for source files. Other versions (=5) probably don’t
work.
- JavaHelp generation will
not work if “Use Tidy over the
split HTML files” is not checked on settings window. JavaHelp seems to need 100% standard HTML input files to
work.
- To generate CHM files with
a character codepage (character set) different than your system
default will only work if the source file is a Unicode encoded HTML
file. MS Word 2003 / 2007 source files will not work.
Interface
Win
Interface
Softoxi has made
a nice video showing the installation and the user interface of the
application.
This is the main
window:

General
|
Help Title
|
Title of the generated
help.
|
|
Cut level
|
Level of sections that is
used to split the document on topics. As example, if a level 2 is
set, the document will be split on many topics as paragraphs with
“Title 1” or “Title 2” ( or tags <H1> / <H2> if the
document is HTML) are found. If is zero, only a topic page will be
generated for the entire document.
|
|
Table of contents max.
level
|
Maximum level of the
sections that will appear on the table of contents of the help. If
is zero, all the titles will appear on the table. As example, if a
level 3 is set, Titles 1, 2 and 3 will appear on the table of
contents.
|
|
Index topics max.
level
|
Maximum level of the
sections that will appear on the index of the help. If is zero, all
the titles will appear on the index. As example, if a level 3 is
set, Titles 1, 2 and 3 will appear on the index.
|
|
Source files
|
List of HTML or Word file
sources to generate the help. Only one HTML file can be used as
source, but multiple Word documents can be used. No HTML and Word
documents can be mixed on the list.
|
|
Additional files
|
List of other files /
directories that must be included on the compiled help. For example
if the source file is an HTML, and it contains images, these
images, or the directory with the images must be included in this
list.
|
|
Execute this command line
after generate
|
If you need to make
something after the generation, as copy the CHM to other place, put
it on a web site by ftp…, you can do it by a command line
here.
|
|
Generate button
|
If the source file is a
word document, you MUST NOT be editing the file, when you
press this button. When this button is pressed, the project / help
generation will start and a new window will be opened, logging the
generation process:

|
Menu
File
Here you can load and save
the current help generation configuration from / to a “project”
file, to access to the last open projects, and edit the settings of
the application.

Compiled
Help
|
Compile help / Dst.
File
|
If it’s checked, the help
will be compiled on a CHM file, on the path selected at the Dst.
File field.
|
|
Generate help
project
|
If it’s checked, a help
project for the Microsoft Help Workshop will be generated at the
directory selected on Dst. Directory, and it will not be
compiled.
|
|
Generate web / Dst. Web
directory / Description meta / Keywords meta
|
If “Generate” it’s checked,
a simple web with the help content will be generated on the Dst.
directory. The description and meta fields are the values of this
“meta” tags at the index of the web page generated.
|
|
HTML Header File
|
Can be null. If not, the
content of this file will be added to the start of each topic page
as header. The content must be HTML code. As example, this file can
contain an IMG tag with the banner of the application
title.
|
|
HTML Footer File
|
Can be null. If not, the
content of this file will be added to the end of each topic page as
footer. The content must be HTML code. As example it can be a
<BR> tag to add an end bar to the page or a script to count
visits at the generated web.
|
|
Language
|
Language of the CHM
contents. If you select a language with a character codepage
distinct of the system default, you must to install
Microsoft AppLocale and check “Use Microsoft AppLocale to comple
CHM files” on the Settings
window.
|
Web
Help
|
Generate Web / Dst. Web
directory
|
If “Generate” it’s checked,
a simple web with the help content will be generated on the Dst.
directory.
|
|
Description meta / Keywords
meta
|
Values of the “meta” tags
at the web pages generated. They should explain to the web indexers
(as Google) the topic of the document.
|
|
HTML Header File
|
Can be null. If not, the
content of this file will be added to the start of each topic page
as header. The content must be HTML code. As example, this file can
contain an IMG tag with the banner of the application title. This
can be different to the header of the CHM.
|
|
HTML Footer File
|
Can be null. If not, the
content of this file will be added to the end of each topic page as
footer. The content must be HTML code. As example it can be a
<BR> tag to add an end bar to the page or a script to count
visits at the generated web, or a javascript code to register the
visits. This can be different to the footer of the CHM.
|
|
Language
|
Language used on the texts
of the web site. If your favourite language is not here, you can
create your own translation. To do this check at the
“webTranslations” folder of the program. Copy the “English.txt” to
your “mylanguage.txt”, open it with the notepad, and change the
text of each second line. Example:
“English.txt”
file:
Contents
Contents
Topics
Topics
…
“mylanguage.txt”:
Contents
<translation of
Contents>
Topics
<translation of
Topics>
…
If you do this, please send
me your file to my mail address at sourceforge, or put
an entry at the patches tracker and it will be added to
the application.
|
|
Make Full Text Search
(Require ASP.NET application)
|
If it’s checked, a full
text index of the document will be created, and all the document
text can be searched. To run the searches, the web site must be
hosted into an ASP.NET server. Only Microsoft IIS 6 and 7 has been
test, but probably will work with the Mono server (only over
Windows). Before run the web application, install the
“Microsoft Primary Interoperability Assemblies
2007” at the web server machine. You
can download it from here. If you don’t install this, you will get an
“ERROR: Could not load file or assembly
Microsoft.mshtml” message and the searches will not
work.
If this field it’s not
checked, a simple search at the web help will allow you to search
at the topic titles of the document only.
|
|
<head> include
file
|
Can be null. If not, the
content of this file will be added into the <head> tag of
each topic page. The content must be valid HTML code for that
head.
As example, it can be the
javascript tag needed by Google Analytics to register the
visits.
|
|
Make Sitemap / Web Base /
Change Freq.
|
If “Make sitemap” is
checked, a file called “sitemap.xml.gz” will be added to the web
site. This file is a help for the web indexers as Google to know
what pages contains your web site. See http://www.google.com/webmasters/sitemaps/
to know more about this file. If you check this
field, you must to put the root of your web site at the field “Web
base” (as example, “http://chmprocessor.sf.net”). At the field “Change
freq.” you say the frequency of change of the document: daily,
monthly, etc.
|
The “template” pages for
the web help are stored at the “webFiles” folder into the
chmProcessor installation. If you want to change the look of the
web help, you can edit them, but don’t change the texts %XXX%
because they are replaced by the application during the generation
process. If you write a nice template and you want to share it with
the world, please send me a message to my mail
address at sourceforge, or put
an entry at the patches tracker and it will be added to the
application.
PDF /
XPS
|
Generate PDF / Dst.
File
|
If it’s checked, a PDF file
will be generated with the printing of the source Word / Html
document at the file on Dst. File. You will need to have the
PDFCreator or the “MS Office 2007 Add-in: Save as PDF / XPS”
installed to use this.
|
|
Generate with PdfCreator /
Generate with Office 2007 add-in (recommended)
|
Choose of how to generate
the PDF file: With PDFCreator o with the MS Office 2007 Add-in.
The last one is the recommended. Only version 1.2 of
PdfCreator will work, and sometimes hangs up the PDF
print.
|
|
Generate XPS / Dst.
File
|
If it’s checked, a XPS file
will be generated with the printing of the source Word / Html
document at the file on Dst. File. You will need to have the the
“MS Office 2007 Add-in: Save as PDF / XPS” installed to use
this.
|
Java
Help
|
Generate Java Help / Dst.
File
|
If it’s checked, the help
will be compile a Java Help JAR file, on the path selected at
the Dst. File field. You will need to have the JDK and the Java
Help installed to use this.
|
Settings
Going to the menu File >
Settings..., you can access to the settings of the
program:

|
MS Help Workshop Compiler
Path
|
Path to the compiler exe
contained into the HTML Help Workshop. It must to point to the
installation directory of this package.
|
|
Use Tidy over the split
HTML files
|
Tidy is software than cleans and
repair HTML files, according to the W3C standards. If it’s checked,
when a HTML page of the help is generated, tidy is executed over
this file. Usually works VERY well, but I have found some problem
with some XHTML files. If you have troubles with the generated HTML
(strange characters, javascript errors, etc) try to uncheck this
field.
|
|
Sun JDK Path
|
Installation path of the
Sun JDK. It’s needed if you want to generate Java Help.
|
|
Java Help directory
path
|
Installation path of the
Sun Java Help. It’s needed if you want to generate Java
Help.
|
|
Save relative paths on
projects
|
If is checked, when you
save a project, the paths to directories and files of the project
will be stored relative to the location of the project file. So, if
you store your source files and the project file on the same
folder, you will can move that folder safely to other locations,
and reopen the project and the reference to the source files will
still work.
If is not checked, paths
will be saved as absolute, so, if you move your source files, they
will not be found.
|
|
Remove/replace broken
internal links
|
If it’s checked, when an
internal link (a link pointing to a place into the same document)
is broken, the application will try to search a section into the
document with the same title as the broken link text. If it’s
found, the link will be changed to point to that section. If no
section is found, the link will be removed, but its content (text,
image, etc) will be kept.
If it’s unchecked, the
broken link will be kept as is.
|
|
Use Microsoft AppLocale to
compile CHM files / path
|
If it’s checked, the
execution of the CHM compiler will be executed by the AppLocate
application. This is only needed if you will generate
a CHM file for a character codepage
distinct than the system default.
This is the short
story:
AppLocate is an application
that changes the codepage of the execution of other
application. If you don’t use it generating a CHM file for a
character
codepage distinct than the system default, the generated table
of contents and index of the CHM file will show wrong
characters.
The long story:
The MS Help workshops, and
so the CHM compiler, are very outdated software, and they don’t
know anything about Unicode. More sad, if
you set a Language on the help workshop project, you encode
the source files for the TOC and index with the right encoding, all
of this is ignored, and the local system locale is used to generate
the CHM file. The patch for this is to use AppLocate, to lie the
CHM compiler about the local codepage. More info about this topic
can be found here: http://blogs.msdn.com/b/sandcastle/archive/2007/09/29/chm-localization-and-unicode-issues-dbcsfix-exe.aspx
|
Console
Interface
Use chmProcessor.exe
[<projectfile.WHC> | <wordfile.DOC>
|<wordfile.DOCX> | <wordfile.HTM> |
<wordfile.HTML>] [/g] [/e] [/y] [/?][/q] [/l1] [/l2]
[/l3]
Options:
/g
Generate help sets (chm, javahelp, pdfs,…)
specified by the project
/e
Exit after generate
/y
Dont ask for confirmations
/?
Print help and exit
/q Prevents a
window being shown when run with the /g command line and logs
messages to stdout/stderr
/l1 /l2 /l3 Lets you choose how much information is
output, where /l1 is minimal and /l3 is all the information
Web Site
Generation
The application can
generate a simple web site with a similar format to the compiled
help. Any topic indexed at the help can be opened directly using
the URL, with the “topic” parameter. As example, if you have a
topic called “Download”, you can open it like this: http://chmprocessor.sf.net/index.html?topic=Downloads.
Here go some examples of
web sites (found
with Bing) that used chmProcessor:
License
The license of chmProcessor
is GPL. It uses the following software:
Downloads
You can download the
chmProcessor installation binaries and sources from here. You can get this document as a PDF
here.
See the changelog
here.
Info for
developers
Here come some tips if you
want to open a help file generated with chmProcessor from your
application. Usually there is tree ways to show a help topic on
your application:
- Open directly the help
file.
- Open a help topic by its
title.
- Open a help topic by its
HTML file name.
The last one is discarded,
because you cannot control how chmProcessor will generate the file
names, and more, those file names can change if you add more titles
to your source help document. So, if you want to open a topic help
directly you should use the topic text titles to open the help.
Here are the functions you can use to open the help by one topic
name on C# and Java:
JavaHelp
Your code should look
something like this, without any warranty:
// The generated JAR must to be on
your class path.
ClassLoader cl =
this.getClass().getClassLoader();
URL hsURL =
HelpSet.findHelpSet(cl, “help.hs”); // help.hs if
the fixed name for the generated help.
HelpSet hs = new
HelpSet(null, hsURL);
HelpBroker hb =
hs.createHelpBroker();
hb.setCurrentID(“The
topic title to show”);
hb.setDisplayed(true);
Much, much more info on the
JavaHelp documentation.
CHM file
with C#
System.Windows.Forms.Help.ShowHelp(null,
“C:\pathtomyhelpfile.CHM” ,
System.Windows.Forms.HelpNavigator.KeywordIndex , “The topic title
to show”);
Web help
with C#
Keep in mind that the topic
title must be encoded for the URL:
System.Diagnostics.Process.Start("http://chmprocessor.sourceforge.net/index.html?topic=Web%20Help");