Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

Svg

Summary: Embedding Scalable Vector Graphics (.SVG) into PmWiki pages
Version: 20150919
Prerequisites: pmwiki 2.2.58
Status:
Maintainer: Petko (originally written by Pm)
Categories: Media, Images, PHP55
Discussion: Svg-Talk
License: GPLv2+

Question

Can Scalable Vector Graphics (*.svg) be embedded into wiki pages?

Answer

The svg.phpΔ script causes links ending in ".svg" to be converted to embedded svg-grafs (similar to how images are automatically embedded into pages).

Install

Place the svg.phpΔ script in your cookbook/ directory, add the line

include_once('cookbook/svg.php');

to your config.php file, and any link ending in ".svg" will automatically be converted to HTML code for an embedded svg graphic.

If you want up upload svg-files you have to enable the file type. Add this to config.php:

  $UploadExts['svg']  = 'image/svg+xml';
  $UploadExts['svgz'] = 'image/svg+xml';

When using this, the %width=300 height=200% WikiStyle has to be placed before the svg file name to define the painting area (set the width and height of your graphic in pixels).

Notes

When installed with Cookbook:Ape, this recipe doesn't allow the Ape recipe to define the frame width and height.

Release notes

  • 20150919 Update for PHP 5.5, use non conflicting $SvgTagFmt variable, accept ".svgz" extension, add $RecipeInfo.

Contributors

Comments

See discussion at Svg-Talk.

User notes +1: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Edit - History - Print - Recent Changes - Search
Page last modified on March 16, 2016, at 05:02 PM