Gnome2::Rsvg - Perl interface to the RSVG library


Gnome2-Rsvg documentation Contained in the Gnome2-Rsvg distribution.

Index


Code Index:

NAME

Top

Gnome2::Rsvg - Perl interface to the RSVG library

SYNOPSIS

Top

  use Gnome2::Rsvg;

  my $svg = "path/to/image.svg";

  # The easy way.
  my $pixbuf = Gnome2::Rsvg -> pixbuf_from_file($svg);

  # The harder way.
  my $handle = Gnome2::Rsvg::Handle -> new();

  open(SVG, $svg) or die("Opening '$svg': $!");

  while (<SVG>) {
    $handle -> write($_) or die("Could not parse '$svg'");
  }

  close(SVG);

  $handle -> close() or die("Could not parse '$svg'");

  $pixbuf = $handle -> get_pixbuf();

ABSTRACT

Top

This module allows a Perl developer to use the Scalable Vector Graphics library (librsvg for short).

SEE ALSO

Top

Gnome2::Rsvg::index(3pm), Gtk2(3pm), Gtk2::api(3pm) and http://librsvg.sourceforge.net/docs/html/index.html

AUTHOR

Top

Torsten Schoenfeld <kaffeetisch at gmx dot de>.

COPYRIGHT AND LICENSE

Top


Gnome2-Rsvg documentation Contained in the Gnome2-Rsvg distribution.

package Gnome2::Rsvg;

use 5.008;
use strict;
use warnings;


# If librsvg-2.0 >= 2.14, we need Cairo.  Gtk2 may or may not load Cairo for,
# so better do it here.
eval "use Cairo;";

use Glib;
use Gtk2;

require DynaLoader;

our @ISA = qw(DynaLoader);
our $VERSION = '0.11';

sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 }

Gnome2::Rsvg -> bootstrap($VERSION);

1;
__END__