SVG tools
A set of python scripts for processing SVG files.They can be used either as a comand line tool or as modules in python.
svgpack▲
This is a tool for packing an SVG file and all it's refferenced images and scripts into a single file.
Images will be embedded using xlink:href="data;..." attribute
If the image refers to an SVG file then this SVG file will be packed and inlined into the output.
Scripts will be inlined using a script element and a CDATA section.
svgpack supports GZip compression and no compression(plain svg file).
In addition to packing all data into a single file it can also just copy all referenced data into a data folder and create a new SVG file which references that data.
svgpack also supports unpacking of SVG files.
It will store all embedded scripts and images in a data folder.
When unpacking it will not unpack previously inlined SVG images.(This will be supported in a later version)
Images will be embedded using xlink:href="data;..." attribute
If the image refers to an SVG file then this SVG file will be packed and inlined into the output.
Scripts will be inlined using a script element and a CDATA section.
svgpack supports GZip compression and no compression(plain svg file).
In addition to packing all data into a single file it can also just copy all referenced data into a data folder and create a new SVG file which references that data.
svgpack also supports unpacking of SVG files.
It will store all embedded scripts and images in a data folder.
When unpacking it will not unpack previously inlined SVG images.(This will be supported in a later version)
svgshow▲
This is a tool for generating slide shows, presentations, ...
Choose a style and select some pictures which will be packed into a single SVG file.
Instead of being packed into a single file the presentation can also be stored in a folder.
The resulting SVG file can then be viewed like any other file.
svgshow uses svgpack to pack the resulting show into a single file or a file + data-folder(see svgpack).
See the examples to find out how a slideshow/presentation is created.
svgshow comes with some predefined styles:
Choose a style and select some pictures which will be packed into a single SVG file.
Instead of being packed into a single file the presentation can also be stored in a folder.
The resulting SVG file can then be viewed like any other file.
svgshow uses svgpack to pack the resulting show into a single file or a file + data-folder(see svgpack).
See the examples to find out how a slideshow/presentation is created.
svgshow comes with some predefined styles:
- slideshow
This is the default style.
It creates a simple picture slide show with a black background.
Use any key, or the left mouse button to forward to the next
Use the "p" - key or the right mouse button to show the previous picture.
The "escape" - key will exit the slide show(when viewd with motjuvie).
Slides may contain subitems which are displayed one after another.
- presentation
This is a style for a presentation.
It creates a slide show with a white background.
The same keys as for the slide show are used for navigation.
The mouse can be used to draw on the slide the following keys set options:
R for rectangle
L for line
E for ellipse
B for brush
1-0 for setting stroke colors(with shift sets fill colors)
O/shift-O for opacity.
S/shift-S for strokewidth.
C for clearing all
W for toggeling a white board
The "escape" - key will exit the slide show(when viewed with motjuvie).
- sharedpresentation
Currently beeing reworked.! It will use a new protocoll and will become a project of it's own. This is an experimental style for a shared presentation.
It behaves like a reagular presentation, except
that slave slides will be synchronized with a master slide using a script on the server.
One can switch the behavior to master, slave, and private.
Master and private presentations are not synced at all.
Only master presentations send synchronization data to a server.
In adition it supports restarting with the "r" - key.
- pass
This is an experimental style for a password encrypted svg file.
The produced file will contain the encrypted SVG file and some JavaScript to decrypt and display it.
Make sure to set the password with the option -p/-password.
usage▲
To use it as a command line tool just start the scripts svgshow.py or svgpack.py and they will display the options.
To use them as modules see the source.
To use them as modules see the source.
examples▲
There are a couple examples generated using svgshow:
You can also find presentations created with this tool at my publications page.
They have been tested and work in Batik and ASV3/ASV6.
You can also find presentations created with this tool at my publications page.
- a presentation
Just a little presentation. Tested with ASV and Batik.
You might have to click into the image for keys to work.
- a picture slideshow
Slideshow of my last trip to norway. Tested with ASV and Batik.
- a shared presentation
It has been tested with Batik and ASV(slave/master will not work with mozilla using ASV6).
Since many people may be viewing the presentation(possibly as master) it might start in the middle when switching to slave mode("s" - key).
Just switch to master("m"-key) mode an hit "r" to restart or "p" for previous slide(item).
If you are in slave mode and someone else is in master mode your presentation should synchronize automatically.
You can try that by opening two browser windows and put one into master mode and the other into slave.
The synchronization is done every 1 second.
The default mode ir private("i"-key) when the presentation starts.
- a password test
This shows a password encrypted SVG(use "pass" as password).
They have been tested and work in Batik and ASV3/ASV6.
downloads▲
requirements:
- Python 2.3
svgpack and svgshow are using features found only in python 2.3 if you want to use them from a command line.
They should work with older versions though if you want to use them as a module.
- PIL
svgshow uses the PIL for getting size information for the images.
PIL is not needed if you use the --auto-size option.
You can download the tools.
Please keep in mind, that the SVG tools are in their early state of development.
Comments and suggestions are appreciated.
The generated SVG files are best viewed with motjuvie
Any other SVG viewer will do as well.
Also check out the other applications in the download section.
changes ▲
2004-03-11
Reworked the styles to include buttons in the presentations and some internal modifications.
Added support for defining a background for all slides of a presentation.
Added support for defining a background for all slides of a presentation.
2004-02-17
Fixed a typo in svgpack.
Error: oject has no attribute 'baseneme'
Error: oject has no attribute 'baseneme'
2003-12-16
Added better drawing tools for presentations.
2003-12-08
Added support for password protected documents.
2003-11-20
- rewrite of SVGAlbum as svgshow.py which is now part of the SVG tools.
- Adding support for using any SVG files as a style.