Hello @ all.
I don't know if this is the right place to ask this questions. But maybe here's a coder/programmer
who knows about my problem:
When I try to merge two svg-files with the following command:
"c:\Program Files\Inkscape\inkscape.exe" --file=C:\temp\file1.svg --verb FileImport="C:\temp\file2.svg"
Inkscape opens the first file but it doesn't import or opens the second, which should be merged in the same document.
I tried with v. 0.91 under 2012r2 and windows 10
Thanks a lot
Chris
Command prompt / batch file
Re: Command prompt / batch file
Hi Chris - did you see the answer I gave in the German forum?
You've got a syntax error in your command:
add a behind
and verbs don't take arguments, unfortunately.
I'm not sure if it might be possible to maybe *copy* contents from one Inkscape instance to the other... Or maybe ~suv has a hint about how this might possibly be automated.
You've got a syntax error in your command:
add a
Code: Select all
=
Code: Select all
--verb
and verbs don't take arguments, unfortunately.
I'm not sure if it might be possible to maybe *copy* contents from one Inkscape instance to the other... Or maybe ~suv has a hint about how this might possibly be automated.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: Command prompt / batch file
As already mentioned by Moini, this is not valid syntax: and cannot work (Inkscape verbs do not take arguments).
Inkscape does not support non-interactively merging multiple SVG files on the command line.
Alternative options (tools, or libraries to build your own script) can be found e.g. on github:
Code: Select all
--verb FileImport="C:\temp\file2.svg"
Inkscape does not support non-interactively merging multiple SVG files on the command line.
Alternative options (tools, or libraries to build your own script) can be found e.g. on github:
- svg_stack (python): svg_stack combines multiple SVG elements into a single SVG element. It can be called from the command line (less flexible) or called from the Python interface (more flexible).
- svg_utils (python): This is an utility package that helps to edit and concatenate SVG files. It is especially directed at scientists preparing final figures for submission to journal. So far it supports arbitrary placement and scaling of svg figures and adding markers, such as labels.
- svg-merge (npm): Merge a folder of svg files into a single file
- svgshelf (npm): A simple CLI for merging multiple svg into a single file, for nodejs/iojs.
-
- Posts: 2
- Joined: Fri Jan 29, 2016 4:16 pm
Re: Command prompt / batch file
Thanks a lot for all the answers.
I found out that a simple dos copy /b file1.svg + file2.svg result.svg did the job (for my specific problem).
Because svg is just xml.
But I don't know, if it works on all different svg's with non unique headers for example.
Many Thanx
Chris
I found out that a simple dos copy /b file1.svg + file2.svg result.svg did the job (for my specific problem).
Because svg is just xml.
But I don't know, if it works on all different svg's with non unique headers for example.
Many Thanx
Chris
Re: Command prompt / batch file
I doubt that will be a valid svg... Sounds like it would just collate them, thus resulting in basically two independent svgs in a single file. Does Inkscape open that? Might work if embedded in a website.
(tried by duplicating a file - nope, Inkscape only shows the first of the two, no matter if they're different or not). Firefox doesn't even open the file.
(tried by duplicating a file - nope, Inkscape only shows the first of the two, no matter if they're different or not). Firefox doesn't even open the file.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
-
- Posts: 70
- Joined: Fri Apr 22, 2016 8:32 am
Re: Command prompt / batch file
To get your SVG's to work check out SVGSplit you can either use the site or get the files from the github and run it locally this will let you have the parts you want to DOS merge