Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can be done with just inkscape? #27

Open
hoijui opened this issue Jul 16, 2020 · 5 comments
Open

Can be done with just inkscape? #27

hoijui opened this issue Jul 16, 2020 · 5 comments

Comments

@hoijui
Copy link
Contributor

hoijui commented Jul 16, 2020

I think it can, if you have a look at man inkscape, and then look for --export-id.

I wanted to use this, because I though it would export all objects into a single file, which is what inkscape can't do, but neither does this script.

still.. thanks for making it available! :-)

@berteh
Copy link
Owner

berteh commented Jul 16, 2020

Hello hoijui,
I don't understand your question/problem.
This script can indeed be used to export each object to a single file, if you want, or just a subset, like groups or anything else... as long as you can expresse which objects you want to export.

@hoijui hoijui changed the title Can be doen with just inkscape? Can be done with just inkscape? Jul 17, 2020
@hoijui
Copy link
Contributor Author

hoijui commented Jul 17, 2020

Sorry! It was indeed badly written (I was tired).
What I mean to say is, that I think what this script does, can be done with inkscape alone (see man page extracts below).
I am using that, and it works. So I was wondering, if this script may provide something extra, or if it was made at a time where inkscape was not yet able to do that or ... something else I can't think of.

What I was looking for when I found this script, was something that could extract multiple objects into a single file, which inkscape can not do directly (though some BASH scripting makes it possible).


-i ID, --export-id=OBJECT-ID[;OBJECT-ID]*

For PNG, PS, EPS, PDF and plain SVG export, the id attribute value of the object(s) that you want to export from the document; all other objects are not exported. By default the exported area is the bounding box of the object; you can override this using --export-area (PNG only) or --export-area-page.

If you specify many values with a semicolon separated list of objects, each one will be exported separately. In this case the exported files will be named this way: [input_filename]_[ID].[export_type]


-j, --export-id-only

For PNG and plain SVG, only export the object whose id is given in --export-id. All other objects are hidden and won't show in export even if they overlay the exported object. Without --export-id, this option is ignored. For PDF export, this is the default, so this option has no effect.


@berteh
Copy link
Owner

berteh commented Jul 17, 2020

Thanks for clarifying.

Indeed this script was written when Inkscape's '-i' option could handle only a single ID.

It does support additional selection/export based on the (XML) element though, that's not (yet?) in Inkscape (see -x option) and selection through pattern In the IDs (see -p option), and selection through exclusion (you just select the objects you don't wanna export, the script exports all others).

See examples: https://github.com/berteh/svg-objects-export#examples

So you can choose to export all layers, or all groups, or all rectangles, or all objects that contain 'small' in their name string (not only their ID!) or all that at the same time... without knowing these objects IDs... and with no need to modify your batch line each time you add one such object in your SVG file.

But maybe someday it will all be included in Inkscape, I don't know... And that's the beauty of opensource :-D

Hope this helps.
Berteh.

@berteh
Copy link
Owner

berteh commented Jul 17, 2020

More examples in the wiki (some more advanced)... but your imagination is the limit:
https://github.com/berteh/svg-objects-export/wiki#usage-examples

If you turn out using this script don't hesitate to share your favourite command line there!

@hoijui
Copy link
Contributor Author

hoijui commented Jul 17, 2020

thanks @berteh ! :-)
so really, it was just not exactly that simple thing I wanted, but still has a lot of benefit, even over the current inkscape.. great! :-)
I guess.. it would make sense for me to use it somehow, but as I have it working without it and .. it is not the most important piece of software (that thing I wrote), I'll leave it at that.
I will need to do more with SVG filtering though, and might come back to this then.

thank you! great interacting with you. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants