File Content Extraction 25.2
HTML Export SDK C Programming Guide

# KVHTMLTemplateEx

This structure defines the overall framework of the HTML output. Members in this structure define the HTML markup written at specific points in the output stream. The pointers contain HTML markup that might include embedded Export Tokens. The structure is initialized by calling the `fpConvertStream()` or `KVHTMLConvertFile()` function. See fpConvertStream() or KVHTMLConvertFile().

    typedef struct tag_KVHTMLTemplateEx
    {
        char        *pszMainTop;
        char        *pszMainBottom;
        char        *pszFirstH1Start;
        char        *pszFirstH1End;
        char        *pszMiddleH1Start;
        char        *pszMiddleH1End;
        char        *pszLastH1Start;
        char        *pszLastH1End;
        char        *pszH[2..6]HTML;
        char        *pszTOCH[1..6]Start;
        char        *pszTOC_H[1..6];
        char        *pszTOCH[1..6]End;
        char        *pszXFile;
        char        *pszStartBlock;
        char        *pszEndBlock;
        BOOL        bPutBlocksInSeparateFiles;
        BOOL        bHardPageMakesNewBlock
        long        lcbBlockSize;
        char        *pszChunkTemplate;
        char        *pszTableHTML;
        BOOL        bTableHTMLForSpreadsheetOnly;
        char        *pszUserSummary;
        char        *pszXStartBlock;
        char        *pszXEndBlock;
        char        *pszTOCH[1..6]LeafNode;
    }
    KVHTMLTemplateEx;

## Member Descriptions

`pszMainTop` | The markup and tokens inserted at the beginning of the main HTML file. Most of the template files feature `<meta>` tags with tokens that store the input document's metadata. This member should at least contain the `<html>` and `<body>` tags. For frame-style output, this member must include the `<frame>` tag. The default is `NULL`.
`pszMainBottom` | The markup and tokens inserted at the end of the main HTML file. This member should at least contain the`</html>` and `</body>` tags, and should close the elements that are opened by `pszMainTop`. The default is `NULL`.
`pszFirstH1Start` | The markup and tokens inserted at the beginning of the first created H1 HTML block (that is, the block associated with the first H1 table of contents entry). The default is `NULL`.
`pszFirstH1End` | The markup and tokens inserted at the end of the first created H1 HTML block (that is, the block associated with the first H1 table of contents entry). The default is `NULL`.
`pszMiddleH1Start` | The markup and tokens inserted at the beginning of those H1 HTML blocks that are neither the first nor the last H1 blocks created (that is, blocks associated with all but the first and last H1 table of contents entries). The default is `NULL`.
`pszMiddleH1End` | The markup and tokens inserted at the end of those H1 HTML blocks that are neither the first nor the last H1 blocks created (that is, blocks associated with all but the first and last H1 table of contents entries). The default is `NULL`.
`pszLastH1Start` | The markup and tokens inserted at the beginning of the last created H1 HTML block (that is, the block associated with the last H1 table of contents entry). The default is `NULL`.
`pszLastH1End` | The markup and tokens inserted at the end of the last created H1 HTML block (that is, the block associated with the last H1 table of contents entry). The default is `NULL`.
`pszH[2..6]HTML` | The markup and tokens inserted in an HTML block for heading levels 2 through 6. The default is `NULL`.
`pszTOCH[1..6]Start` | The markup and tokens inserted at the beginning of a table of contents block for heading levels 1 through 6 entries. For example: `<ol type="I">` `<ol type="1">` `<ol type="i">` The default is `NULL`.
`pszTOC_H[1..6]` | The markup and tokens required to process the table of contents entries for heading levels 1 through 6. For example: `<a href="$ANCHOR" target="right">$TOCTE</a>` The default is `NULL`.
`pszTOCH[1..6]End` | The markup and tokens inserted at the end of a table of contents block for heading levels 1 through 6 entries. For example: `</ol>` The default is `NULL`.
`pszXFile` | The markup and tokens generated and placed in an extra HTML file. This file holds content from the source document. For example, it could contain the table of contents (using the `$TOC` token), which could then be displayed in an HTML frame. To process this file, you would use the `$XANCHOR` token. For example, if the extra file contains the table of contents in frame-based HTML, set `pszXFile=$TOC` and place the following HTML markup in the `pszMainTop` element: `<frame src="$XANCHOR" name="left" scrolling="auto" target="right">` See Export Tokens for more information on Export tokens. The default is `NULL`.
`pszStartBlock` | The markup and tokens inserted at the beginning of each block created as a result of `lcbBlockSize` or `bHardPageMakesNewBlock`. The default is `NULL`.
`pszEndBlock` | The markup and tokens inserted at the end of each block created as a result of the of `lcbBlockSize` or `bHardPageMakesNewBlock`. The default is `NULL`.
`bPutBlocksInSeparateFiles` | Set `bPutBlocksInSeparateFiles` to `TRUE` to create a separate HTML file for each heading level 1 block. Each new block uses the markup defined in `pszStartBlock` and `pszEndBlock`. If you set `bPutBlocksInSeparateFiles` to `FALSE`, each heading level 1 block is placed sequentially in the same file after the initial markup is written. The default is `FALSE`.
`bHardPageMakesNewBlock` | Set `bHardPageMakesNewBlock` to `TRUE` to have hard page breaks in the source document generate new HTML files during the conversion process. The bPutBlocksInSeparateFiles member must also be set to `TRUE`, and the pszChunkTemplate member must specify a table of contents entry for the new file. This option applies to word processing documents and spreadsheets only. Page boundaries in PDF documents are considered page breaks. The default is `FALSE`.
`lcbBlockSize` | The maximum size (in bytes) of heading level 1 HTML output files. This number is used as a guideline and can be exceeded to break content at a logical location. This setting is not used when exporting spreadsheets. To use `lcbBlockSize`, it must be set to a non-zero number, the bPutBlocksInSeparateFiles member must be set to `TRUE`, and the pszChunkTemplate member must specify a table of contents entry for new files created when the maximum size is reached. The default is 0. This means that the size is undefined and unlimited.
`pszChunkTemplate` | If a heading level 1 HTML block is subdivided into separate files because the block exceeds the size limitations specified in `lcbBlockSize`, or `bHardPageMakesNewBlock` is set, or partitioning on hard breaks or page size changes is turned on by using `fpSetPartitionOn`, this member defines the table of contents entry for the new file. The page number can be included in the table of contents entry by inserting the `$SPLITBLOCKNUMBER` token. For example: `Page $SPLITBLOCKNUMBER` The default is `NULL`.
`pszTableHTML` | Specifies the markup (no tokens) inserted at the beginning of each table created during the conversion process. If you set `pszTableHTML`, table cell color and border information from the document is ignored. This is used in conjunction with `bTableHTMLForSpreadsheetOnly` to control the look of generated spreadsheets. For example, to center the table, set the background color to teal, and set the border width to 13, use: `pszTableHTML=<table bgcolor="teal" border="13" align="center">` The default is `NULL`.
`bTableHTMLForSpreadsheetOnly` | If set to `TRUE`, `bTableHTMLForSpreadsheetOnly` controls how spreadsheets are displayed in the output. If set to `FALSE`, cell color and border information from the source document is used. Use this member in conjunction with `pszTableHTML`. The default is `FALSE`.
`pszUserSummary` | The markup and tokens generated when the tokens `$USERSUMMARY` or `$SUMMARY` are used. For example: `<meta name="$NAME" content="$CONTENT" />` The default is `NULL`.
`pszXStartBlock` | The markup and tokens inserted at the beginning of each HTML block generated by the `$XANCHOR` token. If either this member or `pszXEndBlock` is defined, both `pszStartBlock` and `pszEndBlock` are ignored. See Export Tokens for more information on `$XANCHOR`. The default is `NULL`.
`pszXEndBlock` | The markup and tokens inserted at the end of each HTML block generated by the `$XANCHOR` token. If either this member or `pszXStartBlock` is defined, both `pszStartBlock` and `pszEndBlock` are ignored.See Export Tokens for more information on `$XANCHOR`. The default is `NULL`.
`pszTOCH[1..6]LeafNode` | The markup that replaces `pszTOC_H[1..6]` entries for leaf nodes in the table of contents. A leaf node is a node that has no children. The default is `NULL`.

## Discussion

A pointer to this structure is passed as an argument to `fpConvertStream()` and `KVHTMLConvertFile()`. If the pointer to the structure is not `NULL`, the values of the members specified in the structure are used. If the pointer to the structure is `NULL`, the default values are used.

Copyright 1997-2025 Open Text
Version 25.2 | Last updated April 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: File Content Extraction 25.2

Topic Title: KVHTMLTemplateEx