Open topic with navigation

# 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, or the resolution at which graphics are converted. The conversion options can be set 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 data structures:

- KVHTMLTemplateEx

- KVHTMLOptionsEx

- KVHTMLHeadingInfo

- KVHTMLTOCOptions

The conversion options are described in HTML Export API Structures.

## Set Conversion Options by Using the API

Set conversion options by using any of the following functions:

- fpConvertStream()

- KVHTMLConvertFile()

- KVHTMLStartOOPSession()

## 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 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
    bUseDocumentColors=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 structures. In the sample program `htmlini`, a template file is supplied as a command-line argument (see htmlini).

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 C API implementation are in the directory `install\htmlexport\programs\ini`, where `install` is the path name of the Export installation directory. The following templates are provided:

Template | Description
--- | ---
Arabic (`bidi_arabic.ini`) | Based on the default template (`default.ini`). The Arabic character set is defined in the template. `<dir="rtl"`> added to the Body tag to indicate that the text is read from right to left.
Cascading style sheet (`css_ex.ini`) | This template writes style sheet information to an external Cascading Style Sheet (CSS) file or reads the information from an existing CSS file. This makes the HTML output significantly smaller because the information is not stored within the output file. It also allows you to use the same style sheet for many conversions. See Use Style Sheets and Use Style Sheets with htmlini for more information on using an external CSS file.
Default (`default.ini`) | Segments word processing documents, spreadsheets, and presentations into multiple files according to the document’s heading levels. Creates two frames. The table of contents (based on the source document’s heading levels and page breaks) appears in the left frame. The document contents associated with the table of contents entry selected in the left frame appears in the right frame. Inserts Previous and Next buttons at the end of each block. Supports URLs. Supports headers, footers, footnotes, and endnotes. Converts graphics to JPEG with the original size preserved. Converts presentation slides to HTML as individual JPEG files.
Hebrew (`bidi_hebrew.ini`) | Based on the default template (`default.ini`). The Hebrew character set is defined in the template. `<dir="rtl">` added to the Body tag to indicate that text is read from right to left.
Low bandwidth (`lowband.ini`) | This template is useful when you need to provide information to a mobile workforce that might not always have access to fast connections. Creates text-only HTML. Suppresses the source document’s embedded graphics.
Multiple files with three frames (`logotoc.ini`) | Segments word processing documents, spreadsheets, and presentations into multiple files according to the document’s heading levels. Creates three frames. A corporate logo is displayed in the top left frame. The table of contents (based on source document heading levels and page breaks) appears in the bottom left frame, and the HTML files appear in the right frame. Inserts Previous and Next links at the end of each block. Supports URLs.
No frills (`nofrills.ini`) | Creates a single HTML file. Supports URLs. Maintains the source document’s fonts and styles. Does not create a table of contents. Does not list the source document’s metadata.
PDF bookmarks in a frame (`pdfframe.ini`) | This template is optimized to display PDF bookmarks in a separate frame. Segments a PDF file into two HTML files; one contains the table of contents (based on the bookmarks in the PDF file), and the other contains the document text. Creates two frames. The table of contents appears in the left frame, and the document appears in the right frame. Forces the output character set to UTF-8. Does not insert Back to Top, Previous, or Next links. See Convert PDF Files for more information on generating a table of contents from bookmarks in a PDF 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.
Style mapping (`wordstyle.ini`) | This template demonstrates how to map paragraph and character styles in a word processing document to arbitrary markup (including CSS, XML, or HTML). Using style mapping, you can use external Cascading Style Sheet (CSS) files to define styles used in the HTML, alter the structure of a document, delete content, or replace content with a specified character (`redact`). See Map Styles.
UNIX web server (`defunix.ini`) | Based on the default template (`default.ini`). Converts embedded graphics or presentations to either JPEG or HTML Export’s Java target. See Display Vector Graphics on UNIX and Linux.

© 2006-2018 EntIT Software LLC, a Micro Focus company | Send documentation feedback to Micro Focus Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm