-
Notifications
You must be signed in to change notification settings - Fork 28
Home
- Official Documentation: README
- Support: Issues Tracker
Interesting usage examples to integrate in your own workflows: (please contribute!)
-
To export all "group" objects with an id or label that has been modified in inkscape, as long as the id and label don't match:
./svg-objects-export.py --xpath "//svg:g[@inkscape:label!=@id]" input.svg
-
To export all layers of a file in the area of the page first make sure all layers are visible (yes: all at the same time!), save and run:
./svg-objects-export.py --xpath "//svg:g[@inkscape:groupmode='layer']" --extra '--export-area-page --export-id-only' input.svg
-
To export all "root" groups in Inkscape, i.e. all groups with an id that starts with
g
that have no parent group with an id that starts withg
: (explanation)[https://github.com/berteh/svg-objects-export/issues/9]svg-objects-export --xpath "//svg:g[re:test(@id, '^g', 'i')][ not(../../svg:g[re:test(@id, '^g', 'i')]) ]" -d groupWithNoParentGroup/ in.svg
The examples above rely on the inkscape extensions of SVG (The default inkscape format). They won't work with plain svg files (where, a.o. the concept of layers doesn't exist) or SVG files from other software, where you should rely only on valid SVG elements (see SVG specification), or use a specific id naming scheme.
For instance, if you rename all your layers id into "layer1", "layer2",.. "layer25", then you can export them using the following command:
svg-objects-export --pattern "^layer" --extra " --export-id-only" in.svg
- To turn the png into jpgs from command line there is imagemagick: (careful:
mogrify
command overwrites files without warning)mogrify -format jpg -quality 100 *.png