Skip to content
Export d3js graphics to PDF/PNG/SVG
JavaScript Perl
Find file


d3 export demo

This is a proof-of-concept demo for saving d3js graphics as PDF/PNG/SVG files.


CGI takes incoming SVG serialization. Use graphics toolkit to open SVG serialization as input, output PNG or PDF as output.

This perl implementation just performs a system call on rsvg-convert, nothing specific to perl.


See for another nice overview. We just run rsvg-convert man rsvg


See here for more details: *

See here for online demo:

Implementation in other languages

Several people have implemented the CGI portion in other languages:


Copyright (C) 2012,2014 by A. Gordon (

All code written by me is released under BSD license: (also uses several other libraries that have their own licenses).

Something went wrong with that request. Please try again.