pdf2svg

News

  • June 2014: Binaries now available for Windows.

Description

Under Linux there aren’t many freely available vector graphics editors and as far as I know there are none that can edit EPS (encapsulated postscript) and PDF (portable document format) files. I produce lots of these files in my day-to-day work and I would like to be able to edit them. The best vector graphics editor I have found so far is Inkscape but it only reads SVG files… (Edit: recent versions can import PDFs but I’m not entirely happy with how text is imported; in particular, that fonts are not imported from the PDF.)

To overcome this problem I have written a very small utility to convert PDF files to SVG files using Popplerand Cairo. Version 0.2.2 is available here (with modifications by Matthew Flaschen and Ed Grace). This appears to work on any PDF document that Poppler can read (try them in XPDF or Evince since they both use Poppler).

So now it is possible to easily edit PDF documents with your favourite SVG editor! One other alternative would be to use pstoedit but the commercial SVG module costs (unsurprisingly!) and the free SVG module is not very good at handling text… To install

      tar -zxf pdf2svg-0.2.2.tar.gz
      cd pdf2svg-0.2.2
      ./configure --prefix=/usr/local
      make
      make install

To use

pdf2svg <input.pdf> <output.svg> [<pdf page no. or "all" >]

Note: if you specify all the pages you must give a filename with %d in it (which will automatically be replaced by the appropriate page number). E.g.

pdf2svg input.pdf output_page%d.svg all

Source code

A Git repository is also available on GitHub.

Binaries

pdf2svg is packaged for various Linux distributions (including Ubuntu and Fedora) and is available via the different package managers.

32 bit Windows binaries are available; a 64 bit version will be forthcoming.

To cross compile for Windows under Linux, simply install the relevant cross-compiler packages (for Fedora this is mingw32-cairo and mingw32-poppler and their dependencies) and then replace “./configure” in the compilation instructions above with “mingw32-configure”.

Updates

  • 2013-07-18 (v0.2.2): Updated to use the correct renderer call — bitmaps should now appear at full resolution.

Copyright

Copyright © 2007-2013 David Barton
Copyright © 2007 Matthew Flaschen; Updated to allow conversion of all pages at once.
Copyright © 2008 Ed Grace; Added GNU Autotools commands.