Skip to content

Instantly share code, notes, and snippets.

@ryanchang
Created November 26, 2014 05:44
Show Gist options
  • Save ryanchang/829cc04c32e8b4b1bcc0 to your computer and use it in GitHub Desktop.
Save ryanchang/829cc04c32e8b4b1bcc0 to your computer and use it in GitHub Desktop.
Convert all the .svg file in the current directory to .pdf with svg2pdf tool
sources = Dir["./*.svg"]
puts sources
sources.each do |svg|
pdf = "#{svg[0...-4]}.pdf"
%x(svg2pdf #{svg} #{pdf})
end
@ryanchang
Copy link
Author

This gist depends on the svg2pdf tool. You can install this tool via

brew install svg2pdf

on Mac OSX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment