KeyView 24.2

# GetAnchor()

This function should provide the anchor name used for external graphics referenced with `<a xmlns:xlink= xlink href=>` tags, heading-level table of contents entries, and external files (such as CSS files and revision summary files).

The anchor name you provide is passed into GetAuxOutput() to identify the output stream if defined, otherwise it is used as the auxiliary file name.

## Syntax

    BOOL (pascal *GetAnchor)  (
        void                    *pCallingContext,
        KVXMLAnchorType          eAnchorType,
        char                    *pszAnchor,
        int                      cbAnchorMax,
        BYTE                    *pcHTML,
        UINT                     cbHTML);

## Arguments

`pCallingContext` | A pointer that gets passed back to the caller-provided callback functions. This pointer, which can be `NULL`, is specified as the second parameter of the call to `fpConvertStream()`.
`eAnchorType` | The anchor type for the output stream. It must be one of the enumerated types defined in `KVXMLAnchorType`.
`pszAnchor` | A pointer to the memory that you should write the new anchor to.
`cbAnchorMax` | The maximum number of bytes to place in `pszAnchor`.
`pcHTML` | KeyView will have set this to either `NULL` or a pointer to one of the following: markup defining the contents of a table of contents entry the external graphic file name the external file name
`cbHTML` | The number of valid bytes in `pcHTML`.

## Returns

- To continue the conversion, return `TRUE`.
- To terminate the conversion process without completing the conversion, return `FALSE`.

## Discussion

- If this callback is `NULL`, default anchor names are generated. The generated names are unique across the document.

- This function is called once per block, block chunk, graphic anchor, or extra file. Any required code can be executed here as long as a unique value for `pszAnchor` is assigned. If this string is not unique, an existing file might be overwritten, producing undesirable results. The callback function should contain the functionality to verify whether files already exist.

- This function can call the fpGetAnchor() interface function, which returns the default anchor generated by Export. For example, to specify only graphic anchor names, provide an anchor when `eAnchorType` is `VectorPictureAnchor` or `RasterPictureAnchor`. For all other anchor types, call `fpGetAnchor()` with the same parameters you were passed.

- `pszAnchor` must be assigned. It can be derived from the `cbAnchorMax`, `pcHTML`, and `cbHTML` values, which are also provided.

- `pcHTML` can be null if the graphic is an internal part of the document.

Copyright 1997-2024 Open Text
Version 24.2 | Last updated March 2024

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: IDOL KeyView 24.2

Topic Title: GetAnchor()