[ACCEPTED]-Extracting vector graphics from pdf with Inkscape-inkscape

Accepted answer
Score: 21

In my humble opinion, I can suggest the 16 way I use to get vector images from pdf

there is 15 a tool called

pdftocairo, contained into poppler-utils


pdftocairo [options] <PDF-file> [<output-file>]

pdftocairo 14 is able to produce, in output, both raster 13 and vector format, between these last, it 12 is able to convert the content of single pdf page (if you 11 have a multipage pdf doc, you first need to explode this 10 in its single pdf pages, with pdftk for instance), into:

  • -ps : generate PostScript file
  • -eps : generate Encapsulated PostScript (EPS)
  • -svg : generate a Scalable Vector Graphics (SVG) file

the 9 best output format for your needs may be 8 the svg, so after converted the pdf page you 7 can open this svg with any svg app (with 6 inkscape or the good old sodipodi for instance), select 5 the vector elements you want extract and 4 save


if you have a MULTIPAGE PDF

  1. you FIRST split 3 this multipage pdf into its single pages 2 (create a folder for this single pages)

    pdftk file.pdf burst
  2. then 1 use pdftocairo to convert any pdf page into svg

    for f in *.pdf; do pdftocairo -svg $f; done
Score: 13

You can split multi-page pdf files using 2 pdftk, then using inkscape to convert pdf 1 to svg file using command line, e.g

inkscape --without-gui --file=input.pdf --export-plain-svg=output.svg

More Related questions