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 by modifying the following data structures:
These data structures are then passed into functions in the KeyView Export API, such as:
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 htmlini 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
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 ) |
|
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 ) |
|
Hebrew (bidi_hebrew.ini ) |
|
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.
|
Multiple files with three frames (logotoc.ini ) |
|
No frills (nofrills.ini ) |
|
PDF bookmarks in a frame (pdfframe.ini ) |
This template is optimized to display PDF bookmarks in a separate frame.
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.
|
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 ( See Map Styles. |
UNIX web server (defunix.ini ) |
|