Set Conversion Options

Conversion options are parameters that determine the content, structure, and appearance of the HTML output. For example, you can specify:

  • the markup inserted at the beginning and end of specific HTML blocks
  • whether a heading is included in the table of contents
  • the output character set
  • the resolution at which graphics are converted.

Set Conversion Options by Using the API

You set conversion options using the following methods on your instance of HtmlExport:

  • setOptionInfo
  • setTemplateInfo
  • setTOCOptionInfo

For more information about these methods and the options that you can set, refer to the Javadoc supplied with the HTML Export SDK.

Alternatively, you can set conversion options by passing the path of an initialization file to the API using the setIniFileName method on your instance of HtmlExport. For more information about initialization files, see Explore Conversion Options with the Sample Programs.

Explore Conversion Options with the Sample Programs

To make it easier to explore the conversion options, HTML Export includes some sample configurations in the form of initialization (.ini) files. These are read by the HtmlTest sample program (you must supply the .ini file path as a command-line argument). The sample program reads the configuration, and converts your input file into HTML using the options you set, by passing them into the API. This lets you try out conversion options without programming.

You can use a text editor to customize the configuration files. In general, a section name refers to the structure containing an option, and a parameter name matches an element of that structure. For example:

[KVHTMLOptionsEx]
OutputCharSet=KVCS_SJIS
bForceOutputCharSet=TRUE

This sets the OutputCharSet and bForceOutputCharSet elements in the KVHTMLOptionsEx structure.

NOTE: To create valid HTML, an initialization file must define at least two structures: KVHTMLTemplateEx and KVHTMLOptionsEx. Additionally, 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.

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.

  • Outputs vector graphics and presentation slides in SVG format - see Vector Graphics Output.

UNIX web server (defunix.ini)
  • Based on the default template (default.ini).

  • Outputs vector graphics in SVG format - see Vector Graphics Output.