User:Coffman/SVG Extension

From Meta, a Wikimedia project coordination wiki

Jump to: navigation, search
Blue Glass Arrow.svg MediaWiki logo.png
This page should be moved to MediaWiki.org.
Please do not move the page by hand. It will be imported by a MediaWiki.org administrator with the full edit history. In the meantime, you may continue to edit the page as normal.

This is an extension to Mediawiki which tries to renderize SVG graphics and put them onto the wiki. For the rendering process, the extension uses Batik from the Apache Project. There are a few examples at the top of this page ...


Contents

[edit] Requisites

This project uses Batik from the Apache Project. Batik must be installed and functioning correctly before this extension can be used.

[edit] Download

[edit] Install

To install, copy SVGExtension.php to the $mediawiki/extensions directory and add this line to LocalSettings.php:

include("extensions/SVGExtension.php");

Also, within SVGExtension.php, set the following variables as appropriate:

$wgSVGSettings->javaCommand = "/opt/java/j2sdk1.4.0/bin/java";
$wgSVGSettings->batikCommand = "/opt/java/batik-1.5.1/batik-rasterizer.jar";

to complete the installation.

[edit] Samples

There are a lot of samples at the author's wiki

[edit] An improved version

I tried your extension, and made a little improvement.

  • give the link of svg, not only raw data;
  • user can provide parameters to custom image size, etc.

See here: User:Jiangxin/Improved SVG Extension

-- Jiangxin 02:54, 16 November 2005 (UTC)