Functions

cleanup ()

error_quark ()

init ()

pixbuf_from_file (filename)

pixbuf_from_file_at_max_size (filename, max_width, max_height)

pixbuf_from_file_at_size (filename, width, height)

pixbuf_from_file_at_zoom (filename, x_zoom, y_zoom)

pixbuf_from_file_at_zoom_with_max (filename, x_zoom, y_zoom, max_width, max_height)

set_default_dpi (dpi)

set_default_dpi_x_y (dpi_x, dpi_y)

term ()

Details

Rsvg.cleanup()

This function does nothing.

New in version 2.36.

Deprecated since version 2.46: No-op. This function should not be called from normal programs.

Rsvg.error_quark()
Returns:

The error domain

Return type:

int

The error domain for RSVG

Rsvg.init()

This function does nothing.

New in version 2.9.

Deprecated since version 2.36: There is no need to initialize librsvg.

Rsvg.pixbuf_from_file(filename)
Parameters:

filename (str) – A file name

Raises:

GLib.Error

Returns:

A pixbuf, or None on error.

Return type:

GdkPixbuf.Pixbuf or None

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 since version ???: Use [ctor`Rsvg`.Handle.new_from_file] and [method`Rsvg`.Handle.render_document] instead.

Rsvg.pixbuf_from_file_at_max_size(filename, max_width, max_height)
Parameters:
  • filename (str) – A file name

  • max_width (int) – The requested max width

  • max_height (int) – The requested max height

Raises:

GLib.Error

Returns:

A pixbuf, or None on error.

Return type:

GdkPixbuf.Pixbuf or None

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 since version ???: Use [ctor`Rsvg`.Handle.new_from_file] and [method`Rsvg`.Handle.render_document] instead.

Rsvg.pixbuf_from_file_at_size(filename, width, height)
Parameters:
  • filename (str) – A file name

  • width (int) – The new width, or -1

  • height (int) – The new height, or -1

Raises:

GLib.Error

Returns:

A pixbuf, or None on error.

Return type:

GdkPixbuf.Pixbuf or None

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 since version ???: Use [ctor`Rsvg`.Handle.new_from_file] and [method`Rsvg`.Handle.render_document] instead.

Rsvg.pixbuf_from_file_at_zoom(filename, x_zoom, y_zoom)
Parameters:
  • filename (str) – A file name

  • x_zoom (float) – The horizontal zoom factor

  • y_zoom (float) – The vertical zoom factor

Raises:

GLib.Error

Returns:

A pixbuf, or None on error.

Return type:

GdkPixbuf.Pixbuf or None

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 since version ???: Use [ctor`Rsvg`.Handle.new_from_file] and [method`Rsvg`.Handle.render_document] instead.

Rsvg.pixbuf_from_file_at_zoom_with_max(filename, x_zoom, y_zoom, max_width, max_height)
Parameters:
  • filename (str) – A file name

  • x_zoom (float) – The horizontal zoom factor

  • y_zoom (float) – The vertical zoom factor

  • max_width (int) – The requested max width

  • max_height (int) – The requested max height

Raises:

GLib.Error

Returns:

A pixbuf, or None on error.

Return type:

GdkPixbuf.Pixbuf or None

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 since version ???: Use [ctor`Rsvg`.Handle.new_from_file] and [method`Rsvg`.Handle.render_document] instead.

Rsvg.set_default_dpi(dpi)
Parameters:

dpi (float) – Dots Per Inch (aka Pixels Per Inch)

Do not use this function. Create an [class`Rsvg`.Handle] and call [method`Rsvg`.Handle.set_dpi] on it instead.

New in version 2.8.

Deprecated since version 2.42.3: This function used to set a global default DPI. However, it only worked if it was called before any [class`Rsvg`.Handle] objects had been created; it would not work after that. To avoid global mutable state, please use [method`Rsvg`.Handle.set_dpi] instead.

Rsvg.set_default_dpi_x_y(dpi_x, dpi_y)
Parameters:
  • dpi_x (float) – Dots Per Inch (aka Pixels Per Inch)

  • dpi_y (float) – Dots Per Inch (aka Pixels Per Inch)

Do not use this function. Create an [class`Rsvg`.Handle] and call [method`Rsvg`.Handle.set_dpi_x_y] on it instead.

New in version 2.8.

Deprecated since version 2.42.3: This function used to set a global default DPI. However, it only worked if it was called before any [class`Rsvg`.Handle] objects had been created; it would not work after that. To avoid global mutable state, please use [method`Rsvg`.Handle.set_dpi] instead.

Rsvg.term()

This function does nothing.

New in version 2.9.

Deprecated since version 2.36: There is no need to de-initialize librsvg.