Rsvg.Handle.set_stylesheet

### Method

# Rsvg Handleset_stylesheet

since: 2.48

#### Declaration [src]

    gboolean
    rsvg_handle_set_stylesheet (
      RsvgHandle* handle,
      const guint8* css,
      gsize css_len,
      GError** error
    )

#### Description [src]

Sets a CSS stylesheet to use for an SVG document.

The `css_len` argument is mandatory; this function will not compute the length of the `css` string. This is because a provided stylesheet, which the calling program could read from a file, can have nul characters in it.

During the CSS cascade, the specified stylesheet will be used with a “User” origin.

Note that `import` rules will not be resolved, except for `data:` URLs.

Available since: 2.48

#### Parameters

`css`

  Type: An array of `guint8`

  String with CSS data; must be valid UTF-8.

  The length of the array is specified in the `css_len` argument.
  The data is owned by the caller of the method.

`css_len`

  Type: `gsize`

  Length of the `css` data in bytes.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `gboolean`

`TRUE` on success, `FALSE` on error. Errors are returned in the `error` argument.