Conversion options are parameters that determine the content, structure, and appearance of the HTML output. For example, you can specify:
You can set the conversion options either in the API or in the template files. Regardless of the method used to set the options, the values are ultimately passed to the API and used to populate the following
HtmlHeadingInfo
HtmlOptionInfo
HtmlTemplateInfo
HtmlTOCOptionInfo
Use the following classes to set conversion options:
HtmlHeadingInfo
HtmlOptionInfo
HtmlTemplateInfo
HtmlTOCOptionInfo
There are methods to get or set the corresponding objects in the HtmlExport
instance. In the HtmlExport
class, the following methods are available:
getOptionInfo/setOptionInfo
getTemplateInfo/setTemplateInfo
getTOCOptionInfo/setTOCOptionInfo
In the HtmlTOCOptionInfo
class, the following methods are available:
getHtmlHeadingInfo
setHtmlHeadingInfo
HTML Export includes templates in the form of initialization files (.ini
). The templates provide a quick and easy way to modify the conversion options without programming at the API level. However, the template files do not give you complete control of the conversion process. To control some features, you must use the API directly.
You can use a text editor to customize the template files. For example, to change the output character set from the default KVCS_UNKNOWN
to KVCS_SJIS
in the default.ini
template, make the following change shown in bold:
[KVHTMLOptionsEx] OutputCharSet=KVCS_SJIS bForceOutputCharSet=TRUE
To create valid HTML, a template file must define at least two structures: KVHTMLTemplateEx
and KVHTMLOptionsEx
NOTE: If you enter markup in the template files that is not compliant with HTML standards, HTML Export inserts the markup into the output file unchanged. This might result in a malformed HTML file.
An application must then read the template file and write the data to the appropriate Export class. In the HtmlTest
sample program, a template file is supplied as a command-line argument setIniFileName
method.
objHtmlExport.setIniFileName(iniFile);
The characteristics of some of the template files are demonstrated in the HTML Export Getting Started page. The Getting Started page, named htmstart.html
, is in the directory install\htmlexport\docs
, where install
is the path name of the Export installation directory. It compares the output generated using a set of sample documents and the template files. The source documents used in the page are in the directory install\testdocs
.
The template files for the Java API implementation are in the directory install\javaapi\ini\html
, where install
is the path name of the Export installation directory.
The following templates are provided for the Java implementation.
Template |
Description |
---|---|
Callback ( |
|
Single file with table of contents ( |
This template is useful when you want to print the document.
|
|
|