Using vector images in WikidPad

Advantages over bitmap images:

  • Easier to draw sketches and hand-made diagrams
  • Easier to modify graphics
  • Scale and rotate without degrading
  • Don't have to worry about image resolution and color-depth
  • Lower file sizes (for most cases)

There's no support for vector images in WikidPad's internal preview renderer, so they have to be rasterized (converted to png) before they can be displayed.

It makes no difference which format you use (SVG, WMF, DXF), as long as your external application supports command line conversion to PNG. For sake of clarity, in the following examples I assume you are using SVG format.

To use, configure the plugin options and insert [:vector: filename.svg] where you want image to be displayed. Select [:vector: filename.svg] text and use toolbar and menu items to launch vector image editor.
Vector image file filename.svg should be located in YourWikiFolder?\data\

Requirements

To use this plugin, you'll need external vector image rasterizer and editor. So far, the plugin was tested on Windows XP, with either Inkscape or TpX. Both editors can be used for image rasterization without GUI (command line options).

Using with Inkscape

http://www.inkscape.org/
Inkscape is popular heavy-weight vector editor.

Set the plugin options (Wiki -> Options -> Rasterizer):

  • Input file switch: -f
  • Output file switch: -e (for png)
  • Other commandline options: leave blank
  • Path to editor: same as Path to rasterizer

Using with TpX

http://tpx.sourceforge.net/
TpX is a light-weight vector editor, with support for command line options for image conversion. TpX is much faster then Inkscape, but it has some rough edges.

  • Converted images are often too big, to fix this set File -> TpX Settings -> BitmapRes?_Default to value 4000
  • When saving, tpx also creates .eps and .pdf files. To disable this set File -> TpX Settings -> TeXFormat_Deafult and PdfTexFormat?_Default to None
  • If you notice similar behaviour, set mentioned options in Edit -> Picture Properties
  • SVG format is supported, but it's much easier to use .tpx format, as it's default format when saving image (if you opt for .SVG, always use File -> Save As)

Set the plugin options (Wiki -> Options -> Rasterizer):

  • Input file switch: leave blank
  • Output file switch: -o
  • Other commandline options: -x png
  • Path to editor: same as Path to rasterizer (ie. TpX\tpx.exe if you place TpX in WikidPad directory)

Known bugs

Exporting your Wiki to HTML does not work correctly - you need to convert vector images manually. Sorry about that.

Files

Since WikidPad internal API changed around version 2.0, there are two files provided. Please select the correct file based on WikidPad version you are using.

Rasterizer Bridge for WikidPad v1.9

Rasterizer Bridge for WikidPad v2.0 and up

Thanks to Chris Drexler for providing the fix for Wikidpad V2.0

Questions?

Just post them at Yahoo! User Group.

Attachments