Hi Bixente,
Yes indeed, it allows you to export your protovis SVG to a PDF (png,
ps, ..)
you can get the SVG string like this (if vis is the root panel):
var svgString = vis.scene[0].canvas.innerHTML;
But, it seems that various viewers handle SVG differently. And the
rsvg library that i use also suffers from black bars as discussed
here:
http://groups.google.com/group/protovis/browse_thread/thread/d92e7eacff78e01a
So you'd have to "fix" your SVG (as discussed in that thread)
> All of this could be contained in one html file?
Well.. there is posting to the server required.
I use jquery for this, see:
http://api.jquery.com/jQuery.post/
and then after you post the string to the server, you have to return
it.
This is how Django does that:
http://docs.djangoproject.com/en/dev/howto/outputting-pdf/
and where they use reportlab, i use the code that i posted above.
So, you do need a webserver that understands python to make this work.
If you only have a browser and no server, you could skip this approach
entirely, and write the svgString to the screen with
console.log(svgString) or alert(svgString) and then save it to a .svg
file and use inkscape (or some other program) to read/convert it.
Hope this helps,
Jan