Set Conversion Options

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 classes:

Set Conversion Options by Using the API

Use the following classes to set conversion options:

There are methods to get or set the corresponding objects in the HtmlExport instance. In the HtmlExport class, the following methods are available:

In the HtmlTOCOptionInfo class, the following methods are available:

Set Conversion Options by Using the Template Files

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 fully 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 change shown in bold below:

[KVHTMLOptionsEx]
OutputCharSet=KVCS_SJIS
bUseDocumentColors=TRUE

To create valid HTML, a template file must define at least two sections: KVHTMLTemplateEx and KVHTMLOptionsEx.

NOTE: 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 (see HtmlTest). The template file is passed using the 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.

Templates

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 (callback.ini)

  • Based on the default template (default.ini).

  • Implements a user callback named “UserCB_End_Block ” at the bottom of the main HTML file.

Single file with table of contents (onefiletoc.ini)

This template is useful when you want to print the document.

  • Creates a single HTML file.

  • Creates a table of contents at the top of the HTML document.

  • Uses worksheet names to create the table of contents entries for spreadsheets. If worksheet names do not exist in the source document, “Sheet1,” “Sheet2,” “Sheet3,” and so on are used.

  • Uses slide titles to create the table of contents entries for presentations. If slide titles do not exist in the source document, “slide 1,” “slide 2,” “slide 3,” and so on are used.

  • Lists all metadata (title, subject, author, comments, and so on).

  • Converts graphics to JPEG with the original resolution preserved.

  • Converts presentation slides to HTML as individual JPEG files.

UNIX web server (defunix.ini)


_HP_HTML5_bannerTitle.htm