Rsvg – 2.0
Description: Reference for Rsvg-2.0

### Namespace

# Rsvg – 2.0

Librsvg - load and render SVG documents

Version | 2.54.5
Authors | Librsvg developers
License | LGPL-2.1-or-later
Website | https://wiki.gnome.org/Projects/LibRsvg
Source | https://gitlab.gnome.org/GNOME/librsvg/

#### Build

C headers | `librsvg/rsvg.h`
pkg-config files | `librsvg-2.0`

#### Dependencies

#### Additional documentation

- Overview of Librsvg
- Recommendations for Applications
- Migrating from old APIs
- Classes Hierarchy

#### Classes

Handle | `RsvgHandle` loads an SVG document into memory.

#### Structs

DimensionData | Dimensions of an SVG image from `rsvg_handle_get_dimensions()`, or an individual element from `rsvg_handle_get_dimensions_sub()`. Please see the deprecation documentation for those functions. deprecated: 2.46.
Length | `RsvgLength` values are used in `rsvg_handle_get_intrinsic_dimensions()`, for example, to return the CSS length values of the `width` and `height` attributes of an `<svg>` element.
PositionData | Position of an SVG fragment from `rsvg_handle_get_position_sub()`. Please the deprecation documentation for that function. deprecated: 2.46.
Rectangle | A data structure for holding a rectangle. since: 2.46

#### Enumerations

Unit | Units for the `RsvgLength` struct. These have the same meaning as CSS length units.

#### Bitfields

HandleFlags | Configuration flags for an `RsvgHandle`. Note that not all of `RsvgHandle`‘s constructors let you specify flags. For this reason, `rsvg_handle_new_from_gfile_sync()` and `rsvg_handle_new_from_stream_sync()` are the preferred ways to create a handle. since: 2.40.3

#### Error Domains

Error | An enumeration representing possible errors.

#### Callbacks

SizeFunc | Function to let a user of the library specify the SVG’s dimensions. deprecated: 2.14.

#### Functions

cleanup | This function does nothing. deprecated: 2.46 since: 2.36
init | This function does nothing. deprecated: 2.36 since: 2.9
pixbuf_from_file | Loads a new `GdkPixbuf` from `filename` and returns it. The caller must assume the reference to the reurned pixbuf. If an error occurred, `error` is set and `NULL` is returned. deprecated: Unknown
pixbuf_from_file_at_max_size | Loads a new `GdkPixbuf` from `filename` and returns it. This pixbuf is uniformly scaled so that the it fits into a rectangle of size `max_width * max_height`. The caller must assume the reference to the returned pixbuf. If an error occurred, `error` is set and `NULL` is returned. deprecated: Unknown
pixbuf_from_file_at_size | Loads a new `GdkPixbuf` from `filename` and returns it. This pixbuf is scaled from the size indicated to the new size indicated by `width` and `height`. If both of these are -1, then the default size of the image being loaded is used. The caller must assume the reference to the returned pixbuf. If an error occurred, `error` is set and `NULL` is returned. deprecated: Unknown
pixbuf_from_file_at_zoom | Loads a new `GdkPixbuf` from `filename` and returns it. This pixbuf is scaled from the size indicated by the file by a factor of `x_zoom` and `y_zoom`. The caller must assume the reference to the returned pixbuf. If an error occurred, `error` is set and `NULL` is returned. deprecated: Unknown
pixbuf_from_file_at_zoom_with_max | Loads a new `GdkPixbuf` from `filename` and returns it. This pixbuf is scaled from the size indicated by the file by a factor of `x_zoom` and `y_zoom`. If the resulting pixbuf would be larger than max_width/max_heigh it is uniformly scaled down to fit in that rectangle. The caller must assume the reference to the returned pixbuf. If an error occurred, `error` is set and `NULL` is returned. deprecated: Unknown
set_default_dpi | Do not use this function. Create an `RsvgHandle` and call `rsvg_handle_set_dpi()` on it instead. deprecated: 2.42.3 since: 2.8
set_default_dpi_x_y | Do not use this function. Create an `RsvgHandle` and call `rsvg_handle_set_dpi_x_y()` on it instead. deprecated: 2.42.3 since: 2.8
term | This function does nothing. deprecated: 2.36 since: 2.9

#### Function Macros

CHECK_VERSION | This C macro returns `TRUE` if the the version of librsvg being compiled against is the same or newer than the specified version.
DEPRECATED_FOR |

#### Constants

MAJOR_VERSION | This is a C macro that expands to a number with the major version of librsvg against which your program is compiled.
MICRO_VERSION | This is a C macro that expands to a number with the micro version of librsvg against which your program is compiled.
MINOR_VERSION | This is a C macro that expands to a number with the minor version of librsvg against which your program is compiled.
VERSION | This is a C macro that expands to a string with the version of librsvg against which your program is compiled.