Sign In/My Account | View Cart  
advertisement

Article:
 Creating Scalable Vector Graphics with Perl
Subject: Use SVG.pm and do not worry about the underlying XML
Date: 2001-10-12 01:08:55
From: Ronan Oger

#!/usr/bin/perl -w


#
# in case you are on win32 and can not install SVG because there is no PPM for it.
#
# write the path of the location of the SVG.pm and SVG/Utils files
#


BEGIN {
push @INC , '../';
push @INC , '../SVG';
}


use strict;
use SVG;


my $image_height = 60;
my $image_width = 200;


my $writer = SVG->new(width=>$image_width,height=>$image_height);


$writer->rect( height => $image_height,
width => $image_width,
fill => '#005580');


$writer->group( id => 'mainGroup',
transform => 'translate(24,42)',
style => 'font-size:42;font-weight:bold;');


$writer->desc(-cdata=>'JAPH with an XML twist. Features a simple drop shadow.');


$writer->text( -cdata=>'<japh/>',
transform => 'translate(3, 3)',
style => 'fill:#003955');


$writer->text( -cadat=>'<japh/>',style => 'fill:#FFFFFF');


print $writer->xmlify;


Previous Message Previous Message   Next Message Next Message


Sponsored By: