SVG's width, in pixels
SVG's height, in pixels
em
ex
An enumeration representing possible errors
the request failed
The error domain for RSVG
The error domain
Lets you load SVG data and render it.
Returns a new rsvg handle. Must be freed with @g_object_unref. This
handle can be used for dynamically loading an image. You need to feed it
data using @rsvg_handle_write, then call @rsvg_handle_close when done.
Afterwords, you can render it using Cairo or get a GdkPixbuf from it. When
finished, free with g_object_unref(). No more than one image can be loaded
with one handle.
A new #RsvgHandle
Loads the SVG specified by @data.
A #RsvgHandle or %NULL if an error occurs.
The SVG data
The length of @data, in bytes
Loads the SVG specified by @file_name.
A #RsvgHandle or %NULL if an error occurs.
The file name to load. If built with gnome-vfs, can be a URI.
Creates a new #RsvgHandle for @file.
If @cancellable is not %NULL, then the operation can be cancelled by
triggering the cancellable object from another thread. If the
operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
returned.
a new #RsvgHandle on success, or %NULL with @error filled in
a #GFile
flags from #RsvgHandleFlags
a #GCancellable, or %NULL
Creates a new #RsvgHandle for @stream.
If @cancellable is not %NULL, then the operation can be cancelled by
triggering the cancellable object from another thread. If the
operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
returned.
a new #RsvgHandle on success, or %NULL with @error filled in
a #GInputStream
a #GFile, or %NULL
flags from #RsvgHandleFlags
a #GCancellable, or %NULL
Creates a new #RsvgHandle with flags @flags.
a new #RsvgHandle
flags from #RsvgHandleFlags
Closes @handle, to indicate that loading the image is complete. This will
return %TRUE if the loader closed successfully. Note that @handle isn't
freed until @g_object_unref is called.
%TRUE on success, or %FALSE on error
a #RsvgHandle
Gets the base uri for this #RsvgHandle.
the base uri, possibly null
A #RsvgHandle
Get the SVG's size. Do not call from within the size_func callback, because an infinite loop will occur.
A #RsvgHandle
A place to store the SVG's size
Get the size of a subelement of the SVG file. Do not call from within the
size_func callback, because an infinite loop will occur.
A #RsvgHandle
A place to store the SVG's size
An element's id within the SVG, starting with "##", for
example, "##layer1"; or %NULL to use the whole SVG.
Returns the pixbuf loaded by @handle. The pixbuf returned will be reffed, so
the caller of this function must assume that ref. If insufficient data has
been read to create the pixbuf, or an error occurred in loading, then %NULL
will be returned. Note that the pixbuf may not be complete until
@rsvg_handle_close has been called.
the pixbuf loaded by @handle, or %NULL.
An #RsvgHandle
Creates a #GdkPixbuf the same size as the entire SVG loaded into @handle, but
only renders the sub-element that has the specified @id (and all its
sub-sub-elements recursively). If @id is #NULL, this function renders the
whole SVG.
If you need to render an image which is only big enough to fit a particular
sub-element of the SVG, consider using rsvg_handle_render_cairo_sub(), upon a
surface that is just the size returned by rsvg_handle_get_dimensions_sub().
You will need to offset the rendering by the amount returned in
rsvg_handle_get_position_sub().
a pixbuf, or %NULL if an error occurs
during rendering.
An #RsvgHandle
An element's id within the SVG, starting with "##", for
example, "##layer1"; or %NULL to use the whole SVG.
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.
A #RsvgHandle
A place to store the SVG fragment's position.
An element's id within the SVG, starting with "##", for
example, "##layer1"; or %NULL to use the whole SVG.
Checks whether the element @id exists in the SVG document.
%TRUE if @id exists in the SVG document
a #RsvgHandle
an element's id within the SVG, starting with "##", for example, "##layer1".
Reads @stream and writes the data from it to @handle.
If @cancellable is not %NULL, then the operation can be cancelled by
triggering the cancellable object from another thread. If the
operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
returned.
%TRUE if reading @stream succeeded, or %FALSE otherwise
with @error filled in
a #RsvgHandle
a #GInputStream
a #GCancellable, or %NULL
Draws a SVG to a Cairo surface
%TRUE if drawing succeeded.
A #RsvgHandle
A Cairo renderer
Draws a subset of a SVG to a Cairo surface
%TRUE if drawing succeeded.
A #RsvgHandle
A Cairo renderer
An element's id within the SVG, or %NULL to render
the whole SVG. For example, if you have a layer called "layer1"
that you wish to render, pass "##layer1" as the id.
Set the base URI for @handle from @file.
Note: This function may only be called before rsvg_handle_write()
or rsvg_handle_read_stream_sync() has been called.
a #RsvgHandle
a #GFile
Set the base URI for this SVG. This can only be called before rsvg_handle_write()
has been called.
A #RsvgHandle
The base uri
Sets the DPI for the outgoing pixbuf. Common values are
75, 90, and 300 DPI. Passing a number <= 0 to @dpi will
reset the DPI to whatever the default value happens to be.
An #RsvgHandle
Dots Per Inch (aka Pixels Per Inch)
Sets the DPI for the outgoing pixbuf. Common values are
75, 90, and 300 DPI. Passing a number <= 0 to #dpi_x or @dpi_y will
reset the DPI to whatever the default value happens to be.
An #RsvgHandle
Dots Per Inch (aka Pixels Per Inch)
Dots Per Inch (aka Pixels Per Inch)
Loads the next @count bytes of the image. This will return %TRUE if the data
was loaded successful, and %FALSE if an error occurred. In the latter case,
the loader will be closed, and will not accept further writes. If %FALSE is
returned, @error will be set to an error from the #RsvgError domain. Errors
from #GIOErrorEnum are also possible.
%TRUE on success, or %FALSE on error
an #RsvgHandle
pointer to svg data
length of the @buf buffer in bytes
SVG's description
Flags from #RsvgHandleFlags.
SVG's description
SVG's description
parent instance
Class structure for #RsvgHandle.
parent class
none
Allow any SVG XML without size limitations.
For security reasons, this should only be used for trusted input!
Since: 2.40.3
Keeps the image data when loading images,
for use by cairo when painting to e.g. a PDF surface. This will make the
resulting PDF file smaller and faster.
Since: 2.40.3
Position of an SVG fragment.
position on the x axis
position on the y axis
This function should not be called from normal programs.
See xmlCleanupParser() for more information.
The error domain for RSVG
The error domain
Do not use this function. Create an #RsvgHandle and call
rsvg_handle_set_dpi() on it instead.
This function used to set a global default DPI. However,
it only worked if it was called before any #RsvgHandle objects had been
created; it would not work after that. To avoid global mutable state, please
use rsvg_handle_set_dpi() instead.
Dots Per Inch (aka Pixels Per Inch)
Do not use this function. Create an #RsvgHandle and call
rsvg_handle_set_dpi_x_y() on it instead.
This function used to set a global default DPI. However,
it only worked if it was called before any #RsvgHandle objects had been
created; it would not work after that. To avoid global mutable state, please
use rsvg_handle_set_dpi() instead.
Dots Per Inch (aka Pixels Per Inch)
Dots Per Inch (aka Pixels Per Inch)