# GetAnchor()

This function gets the file name automatically generated by Export and used for external graphics referenced with `<img>` tags, heading-level table of contents entries, and external files (such as CSS files and revision summary files).

## Syntax

    BOOL (pascal *GetAnchor)  (
        void                    *pCallingContext,
        KVHTMLXMLAnchorTypeEx          eAnchorTypeEx,
        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()`.
`eAnchorTypeEx` | The anchor type for the output stream. It must be one of the enumerated types defined in `KVHTMLAnchorTypeEx`.
`pszAnchor` | A pointer to the location where the new anchor is stored.
`cbAnchorMax` | The maximum number of bytes to place in `pszAnchor`.
`pcHTML` | This is 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

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

- If the call is unsuccessful, the return value is `FALSE`. Processing is halted.

## 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.

- If you want to specify graphic anchor names, but use default anchor names for all other anchors, provide the graphic names when `eAnchorTypeEx` is `VectorPictureAnchorEx` or `RasterPictureAnchorEx`. For all other anchor types, call 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 2006-2019 Micro Focus or one of its affiliates | Send documentation feedback Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a mail client, and then send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm