title: SVG to PDF on a shared linux server
body: <p>I have a website which uses SVG for an interactive client side thingamabob. I would like to provide the option to download a PDF of the finished output. I can pass the final SVG output back to the server, where I want to convert to PDF, then return it to the client for download.</p>
  
  <p>This would need to work on a headless shared linux server, where installation or compilation is either an enormous pain, or impossible. The website is PHP, so the ideal solution would be PHP, or use software that's easily installed on a shared webserver. Python, perl and ruby are available, along with the usual things you might expect on a linux box. Solutions that involve cairo, scripting inkscape, or installation more complex than 'FTP it up' are probably out. Spending large amounts of money are also out, naturally. As this is a shared server, memory and/or CPU hungry solutions are also out, as they will tend to get killed; this more or less rules out Batik.</p>
  
  <p>The nearest that I've got so far is <a href="http://code.google.com/p/lindenb/source/browse/trunk/src/xsl/svg2ps.xsl" rel="noreferrer">this XSL transform</a> which I can drive from PHP and then squirt the resulting postscript through ps2pdf (which is already installed). The only problem with this is that it doesn't support SVG paths - if it did, it would be perfect.</p>
  
  <p>There are a bunch or related questions on StackOverflow, all of which I've read through, but they all assume that you can either install stuff, spend money, or both.</p>
  
  <p>Does anyone have an off-the-shelf solution to this, or should I just spend some downtime trying to add paths support to that XSL transform?</p>
  
  <p>Thanks,
  Dunc</p>