views:

2041

answers:

5

I'm looking to programmatically convert SVG to PDF documents on a server. What are my options for doing that on Windows?

I've seen links to Inkscape, Batik, and svg2pdf, but I'm not sure if these can easily be automated to perform the conversion on a Windows server.

There's an unusual solution here which involves automating OpenOffice Portable on the server: http://www.codeproject.com/KB/office/PortableOpenOffice.aspx

Thanks

+2  A: 

Take a look at the Apache Batik Toolkit. The rasterizer can convert svg to images or pdf (It's a java tool).

The SVG Rasterizer is a utility that can convert SVG files to a raster format. The tool can convert individual files or sets of files, making it easy to convert entire directories of SVG files. The provided formats are JPEG, PNG and TIFF, however the design allows new formats to be added easily. In addition, the rasterizer can (despite its name) transcode to PDF.

räph
+1  A: 

It does not come free, but PrinceXML does a very good job with SVG.

Vincent Buck
+1 yes it does indeed!
tharkun
A: 

Hi there,

you might want to look into Apache FOP.
Check out the part about graphic formats.

kind regards

timbooo
+4  A: 

There are two options:

  • Batik (Java, open source)
  • Inkscape (native binary, open source)

Batik will give you more control. With Inkscape, you can use the command line parameters (--export-pdf IIRC) to do the conversion without firing up the UI.

Aaron Digulla
Great Batik worked really well. Inkscape seemed to create a PDF that caused our printer to reboot when printed!
Matthew Lock
Just a note: Batik doesn't convert SVG text to PDF text, at least as of October 2009.
molecules
A: 

You can probably use Cairo and librsvg to read SVG into Cairo surface and export to PDF using Cairo. There are many bindings for languages and these are open source libraries.

arcanum