12

When I have a directory full of .svg files, e.g. from Inkscape, how is it possible to convert them to .pdf files?

Similar to this approach for a single file, but as a batch command for a whole directory.

user36028
  • 451
  • 4
  • 9

1 Answers1

21

In this post, the procedure is shown for a single file.

The relevant command is:

rsvg-convert -f pdf -o t.pdf t.svg

For a whole directory, a simple bash script does the job:

for i in *.svg;do rsvg-convert -f pdf -o ${i%.*}.pdf $i;done

This assumes that you have rsvg-convert installed, if not you can get it by typing:

sudo apt-get install librsvg2-bin
Benjamin Loison
  • 183
  • 1
  • 6
user36028
  • 451
  • 4
  • 9