Use SVG;
# New SVG
My $svg = Svg->new (
width = 4000,
Height = 5000,
);
# text object, the key is the font type, at first only with ' font ' = ' Arial ', the Web page display font does not look Arial, do not know why. In short, set to ' font-family ', just fine.
Text $svg-
id = ' Txttitle ',
x = 100,
y = 50,
style = {' font-family ' = ' Arial, Helvetica, Sans-serif ', ' Font-size ' =>40}
)->cdata ($txt _header);
# line Object
$svg->line (
Id=> "line". $m,
X1=> $border, y1=> $abs _high+ ($tmprow + 1) * ($border + $image _high) +30,
X2=> $ncol * ($border + $image _width), y2=> $abs _high+ ($tmprow + 1) * ($border + $image _high) +30,
style=>{' stroke-width ' = ' 2.5 ', ' stroke ' = ' black '}
);
# Image Object
$svg->image (
X=> ($tmpcol + 1) * $border + $tmpcol * $image _width+40, y=> $abs _high+ ($tmprow + 1) * $border + $tmprow * $image _high,
Width=> $image _width, height=> $image _high,
'-href ' = "$txt _header/$plt _name[$m].jpg", #may also embed SVG, e.g. "image.svg"
Id=> "Image$m"
);
# Output SVG object as XML format
Open (out, "> $txt _header.svg") | | Die
Print out $svg->xmlify;
Close out;
# above are all common object in SVG display, if needed, view http://search.cpan.org/~ronan/SVG-2.28/SVG/Manual.pm
The #每个object size and position can be adjusted to suit your needs.
Perl generates SVG XML file