Converting PDF and PNG Files to SVG with Inkscape

February 2026

← Back to other guides

This guide shows you how to use Inkscape's command-line interface to convert .png and .pdf files into .svg format. In the commands below, replace NAME with your actual filename (without extension).

PNG → SVG

Converting a PNG to SVG works by tracing the bitmap image into vector paths. Inkscape's Trace Bitmap action handles this automatically.

inkscape NAME.png \
  --actions="select-all;trace-bitmap;export-plain-svg:NAME.svg;export-do"
What this does:

PDF → SVG

PDFs already contain vector data, so conversion is straightforward — Inkscape reads the PDF geometry and writes it out as SVG directly.

inkscape NAME.pdf --export-filename=NAME.svg
Multi-page PDFs: By default, only the first page is exported. To export a specific page, add --pdf-page=N (e.g. --pdf-page=2 for page 2).

Batch conversion

All PNGs in a directory

for f in *.png; do
  inkscape "$f" \
    --actions="select-all;trace-bitmap;export-plain-svg:${f%.png}.svg;export-do"
done

All PDFs in a directory

for f in *.pdf; do
  inkscape "$f" --export-filename="${f%.pdf}.svg"
done

Verify Inkscape is installed and on your PATH

inkscape --version
Common pitfalls: