Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically convert SVG to PDF on Windows?

Tags:

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

like image 410
Matthew Lock Avatar asked Jun 26 '09 09:06

Matthew Lock


People also ask

Is SVG a PDF vector file?

SVG is a vector graphic image file extension that contains scalable images. This XML based file extension supports animation that can contains vector graphics, raster graphics, and text. It uses lossless data compression algorithm to contain data. It can be edited drawing software as well as text editors also.

What is the best PDF to SVG converter?

Best 5 PDF to SVG Converter on Windows/Mac/Online: Inkscape. Adobe Illustrator. Zamzar. Convertio.


2 Answers

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.

like image 83
Aaron Digulla Avatar answered Oct 15 '22 19:10

Aaron Digulla


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.

like image 20
räph Avatar answered Oct 15 '22 17:10

räph