File Content Extraction 26.1
HTML Export SDK C Programming Guide

# KVHTMLSetHighlight()

This function is called directly and enables you to specify search terms that are found and highlighted in the HTML output. See Search and Highlight Terms. The `htmlini` sample program demonstrates this function. See htmlini.

## Syntax

    int pascal_export KVHTMLSetHighlight(
        void             *pContext,
        KVHTMLHighlight  *pHLConfig,
        void             *pReserved1,
        void             *pReserved2 );

## Arguments

`pContext` | A pointer to an Export session that you initialized by calling fpInit().
`pHLConfig` | A pointer to the `KVHTMLHighlight` data structure. This structure defines the terms to be found and the highlight format applied. See KVHTMLHighlight.
`pReserved1` | Reserved for future use.
`pReserved2` | Reserved for future use.

## Returns

- If the call is successful, the return value is `KVERR_Success`.

- If the call is unsuccessful, the return value is an error code.

## Discussion

- This function must be called after the call to fpInit() and before the call to `fpConvertStream()` or `KVHTMLConvertFile()`.

- When converting out-of-process, this function must be called before the call to `KVHTMLStartOOPSession()`. See Convert Files Out-of-Process.

## Example

    KVHTMLHighlight     HTMLHighlight;
    int (pascal *fpHTMLSetHighlight)(void *, KVHTMLHighlight *, void *, void *);
    //get function pointer and call the function
    fpHTMLSetHighlight = (int (pascal *)
       (void *, KVHTMLHighlight *, void *, void*))myGetProcAddress(hKVHTML, "KVHTMLSetHighlight");
       if(!fpHTMLSetHighlight)
       {
          printf("Error accessing HTMLSetHighlight().\n");
       }
       else
       {
          if(KVERR_Success != (*fpHTMLSetHighlight)(pKVHTML, &amp;HTMLHighlight, NULL, NULL))
          {
             printf("Error setting HTML highlight.\n");
          }
       }
    }

Copyright 1997-2025 Open Text
Version 26.1 | Last updated January 2026

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 26.1

Topic Title: KVHTMLSetHighlight()