6

I want to convert a SVG file to PDF from the command line on Mac OSX. Is there any way to do this?

1
  • It's not exactly the command line, but gapplin.wolfrosch.com is a free app that provides AppleScript and Automator actions. Commented Oct 6, 2023 at 21:22

3 Answers 3

10

Yes, you can do this by using the rsvg-convert command. You can install it using homebrew, just type:

brew install librsvg

After that you can convert SVG files to PDF using the following command:

rsvg-convert -f pdf -o file.pdf file.svg
2
  • 2
    This does not support embedded fonts unfortunately.
    – Timmmm
    Commented Apr 7, 2022 at 13:26
  • Also doesn't seem to handle an SVG an <image> with a base64-encoded SVG in it — produces a rasterized version of the embedded SVG Commented Oct 6, 2023 at 21:21
6

Inkscape can be called on the command line, and you can convert SVG to PDF with:

inkscape --export-filename=out.pdf in.svg
0

Open the .svg with Safari and "File > Export as PDF..."

1
  • Good to know, the question asked for a command-line solution though.
    – nohillside
    Commented Sep 8, 2023 at 15:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .