convert pdf to svg from command line
Are there any command line options for the inkscape executable to convert PDF to SVG?
Thanks, Matei
On Thu, Jun 12, 2008 at 7:26 AM, Matei Stroila <mns3m@...12...> wrote:
Are there any command line options for the inkscape executable to convert PDF to SVG?
Thanks, Matei
I'm not sure how to do this. You could use something like ImageMagick to convert the pdf to a png first, and then use inkscape to open the file and export a plain svg:
--------------------------------------------- convert -density 200 fileA.pdf fileB.png
inkscape -f fileB.png -l fileC.svg
-------------------------------------------- This indeed does create an svg file, but it is an svg file containing a bitmap. The vector representation of the original pdf is lost when you first convert it to png.
I'm not sure there is a way of opening a pdf file in Inkscape. And ImageMagick can't convert from PDF to SVG (at least not that I'm aware of). Perhaps there is some other tool that can do the job.
RQ
On Thu, Jun 12, 2008 at 8:26 AM, Matei Stroila <mns3m@...12...> wrote:
Are there any command line options for the inkscape executable to convert PDF to SVG?
I just fixed it in SVN (rev 18892) so now this will work:
inkscape file.pdf --export-plain-svg=file.svg
It will take the first page of the PDF and all the default import options. Before, it crashed because it tried to open the PDF import preferences dialog and could not do it in the command line mode.
bulia byak wrote the following on 6/12/2008 1:12 PM:
On Thu, Jun 12, 2008 at 8:26 AM, Matei Stroila <mns3m@...12...> wrote:
Are there any command line options for the inkscape executable to convert PDF to SVG?
I just fixed it in SVN (rev 18892) so now this will work:
inkscape file.pdf --export-plain-svg=file.svg
It will take the first page of the PDF and all the default import options. Before, it crashed because it tried to open the PDF import preferences dialog and could not do it in the command line mode.
A fairly decent alternative is pdf2svg from pdftron (http://www.pdftron.com/pdf2svg/index.html). It's a cross-platform command-line app that seems to work rather well with Inkscape. One can batch out a directory full of pdf's and convert them to svg, lickety split.
Example:
pdf2svg -o converted_svg *.pdf
heathenx
participants (4)
-
bulia byak
-
heathenx
-
Matei Stroila
-
Richard Querin