svg2pdf and svg2eps (convert svg to pdf or eps from the command line)

I’ve been working on a new makefile for my latex projects. The goal is to have single-source builds of dvi, pdf, and xhtml documents. I ran into a problem of generating figures. latex expects eps graphics, pdflatex expects pdf figures, and latexml expects png figures (or will try to generate them). In order to generate documents with make, I need a way to generate eps and pdf figures from svg sources (I usually use inkscape to make my figures). Inkscape can be run from the command line, but I dont want to install inkscape on my server because that will require installing a ton of libraries that don’t make sense to have on a server with no graphical interface.

As it turns out, writing such a command line tool is very easy with librsvg and cairo. Carl Worth of redhat has produced a nice demo of svg2pdf which can be found at I cloned his project, create a cmake project out of it, and made a trivial modification to turn it into svg2eps as well.

You can find my code at git:// and there’s some doxygen documentation Doxygen documentation.

  1. #1 by Ilario on August 24, 2013 - 10:06 am

    The last link in this article seems broken, is this the correct one?

    • #2 by cheshirekow on September 10, 2013 - 3:09 pm

      You got it. I gave up on redmine, so ~projects/svg2x is the documentation. I’ve updated the post with a git URL as well.

  2. #3 by Dakotadelnorte on January 21, 2015 - 10:14 am

    Please, activate the repository or publish a new link in order to download the tool. Thank you in advance.

(will not be published)