Personal tools
You are here: Home Projects gan2svg

gan2svg

XSL sheet to convert ganttproject XML files to SVG images.

About:

This XSL sheet transforms XML files created by ganttproject to SVG images. There are some advantages compared to PNG images:

  • depending on the project SVG images can be smaller in file size than the PNG counterpart (especially when gzip compressed, a.k.a. svgz images)
  • SVG images can be scaled without quality loss (means better printing quality)
  • SVG images can be easily edited by vector-graphic tools like sodipodi
  • SVG images can be integrated as PDF drawing commands by Apache FOP which greatly improves printing quality and PDF-filesize.

xsvg using cairo does not display the SVG image correctly (does not show the background pattern, status Aug.2004). KSVG from the KDE v3.3 project displays pattern and workaround (workaround is much slower displayed). librsvg from Gnome project is currently untested by me. Sodipodi v0.34 does open it correctly. Apache FOP together with Batik - special case: Batik tries to convert the pattern to a bitmap graphic, where it fails grossly, using the workaround works nicely though - look at PDF output below.

Changelog:

  • 2004-08-23:
    • XSL now without import of date module
    • nicer output - every sunday is shown in bold style.
    • new parameter to switch between SVG pattern usage and a workaround (add --param use_pattern 1 to your cmd-line to enable pattern usage, it is disabled by default)
  • 2004-08-22: first version released.

Usage:

  • get my XSL sheet: download gan2svg.xsl
  • be sure to use a transformer that supports the date extension from EXSLT (e.g. xsltproc, but not Xalan-J 2.6.0 it does not support date:add())
  • if the date extension is broken for xslt your may apply this patch (patch only needed if you want to import the templates, extension is also built into libxslt)
  • run xsltproc -o output.svg gan2svg.xsl project.gan to create the SVG image with the default parameters enabled
  • run xsltproc -o output.svg --param show_progress 0 gan2svg.xsl project.gan to disable the output of the tasks progress for example. See the XSL sheets source for more parameters.

Examples:

  • GAN (ganttproject file)
  • PNG
  • SVG (use_pattern 1)
  • PDF (created using FOP and the SVG use_pattern 0)

ToDo:

  • Draw Task-dependencies, although i don't know yet how to do that intelligently
  • Support for Zoom-Levels
Document Actions
« February 2012 »
February
MoTuWeThFrSaSu
12345
6789101112
13141516171819
20212223242526
272829