Search code examples
svginkscapedxf

Convert SVG to DXF in Inkscape CLI


I wonder how can we convert SVG to DXF in Inkscape CLI mode. IN GUI to export/save svg to dxf we can do it from file menu by doing Save As

i went through inkscape cli document : https://inkscape.org/doc/inkscape-man.html

here mostly export words is used , so i tried

inkscape --export-type=out.dxf in.svg
inkscape --export-filename=out.dxf in.svg

but no success giving me errpr

InkFileExportCmd::export: Unknown export type: out.dxf. Allowed values: [svg,png,ps,eps,pdf,emf,wmf,xaml].

however in GUI under FILE -> SAVE AS we can see a lot of file formats including DXF


Solution

  • You need to run the extension from the command line, using the available parameters. Find it in your Inkscape installation folder, inside the directory /share/inkscape/extensions.

    So, in the most basic version:

    python3 dxf_outlines.py  --output="yourfile.dxf" "yourfile.svg"
    

    You can also type

    python3 dxf_outlines.py -h
    

    to find out all about the options.