This website demonstrates one possible method of saving d3js graphics to PDF.
Click “view source” on above website to see the client-side code. It is heavily documented.
The server-side code is a bare-bones Perl/CGI script.. It basically runs rsvg-convert
and returns the result as an attachment to download. You can implement the same functionallity in any programming language.
The entire code is available on GitHub