### Method

# Rsvg Handle get_position_sub

#### Declaration [src]

    gboolean
    rsvg_handle_get_position_sub (
      RsvgHandle* handle,
      RsvgPositionData* position_data,
      const char* id
    )

#### Description [src]

Get the position of a subelement of the SVG file. Do not call from within the size_func callback, because an infinite loop will occur.

This function depends on the `RsvgHandle`‘s DPI to compute dimensions in pixels, so you should call `rsvg_handle_set_dpi()` beforehand.

Element IDs should look like an URL fragment identifier; for example, pass `#foo` (hash `foo`) to get the geometry of the element that has an `id="foo"` attribute.

Available since: | 2.22
Deprecated since: | 2.46.
Use `rsvg_handle_get_geometry_for_layer()` instead. This function is deprecated since it is not able to return exact floating-point positions, only integer pixels.

#### Parameters

`position_data` | `RsvgPositionData`
| A place to store the SVG fragment’s position.
| The argument will be set by the function.
| The data is owned by the caller of the function.
`id` | `const char*`
| An element’s id within the SVG, starting with “#” (a single hash character), for example, `#layer1`. This notation corresponds to a URL’s fragment ID. Alternatively, pass `NULL` to use the whole SVG.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.

#### Return value

Returns: | `gboolean`
| `TRUE` if the position could be obtained, `FALSE` if there was an error.