manpagez: man pages & more
html files: rsvg-2.0
Home | html | info | man

Overview of Librsvg's API

Librsvg's API is divided into two main parts: one for loading SVG data and one for rendering it. In the loading stage, you create an RsvgHandle object from SVG data, which can come from a file or from a stream of bytes. In the rendering stage, you take an RsvgHandle and ask it to render itself to a Cairo context.

Loading

RsvgHandle is an object that represents SVG data in memory. Your program creates an RsvgHandle from an SVG file, or from a memory buffer that contains SVG data, or in the most general form, from a GIO stream that will provide SVG data. At this stage you can get either I/O errors or parsing errors. If loading completes successfully, the RsvgHandle will be ready for rendering.

Generally you should use rsvg_handle_new_from_gfile_sync() or rsvg_handle_new_from_stream_sync() to load an SVG document into an RsvgHandle. There are other convenience functions to load an SVG document, but these two functions let one set the "base file" and the RsvgHandleFlags in a single call.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.