command line operation to reduce document boundry
i am wondering if there is a command for the inkscape command line that allows an svg's document boundry to be reduced to fit tight around all the elements.
If there is not one, it sure would be handy for us over at the openclipart library...
cheers,
ryanlerch
On Tue, 2007-01-23 at 09:20 +1000, ryan lerch wrote:
i am wondering if there is a command for the inkscape command line that allows an svg's document boundry to be reduced to fit tight around all the elements.
If there is not one, it sure would be handy for us over at the openclipart library...
cheers,
ryanlerch
Oh wait, this is easy to do...
1.) add a commandline option for this option
2.) select all items on canvas, or if an option passed, selects the group id
3.) calls up the "Fit Page to Selection" command (which can be seen in the document properties dialog).
That should do it...
If I add this, should I add this to the inkscape menu. If so, where should it go in the menu?
Bulia, I know you will want a say in this ;)
Jon
On Mon, 22 Jan 2007, Jon Phillips wrote:
On Tue, 2007-01-23 at 09:20 +1000, ryan lerch wrote:
i am wondering if there is a command for the inkscape command line that allows an svg's document boundry to be reduced to fit tight around all the elements.
If there is not one, it sure would be handy for us over at the openclipart library...
cheers,
ryanlerch
Oh wait, this is easy to do...
1.) add a commandline option for this option
2.) select all items on canvas, or if an option passed, selects the group id
3.) calls up the "Fit Page to Selection" command (which can be seen in the document properties dialog).
That should do it...
If I add this, should I add this to the inkscape menu. If so, where should it go in the menu?
might be better to create a verb for fit to selection if it doesn't already exist and use it with the existing select all verb then create an extension script to wrap it and create a menu item that way users can add it relatively easily by dropping it in the appropriate folder and restart inkscape.
but dont ship it by default, a better default would be to improve the relevant dialog for resizing pages. otherwise you risk getting even further into the menu item for every little feature mentatility gimp sometimes suffeers from (thankfully not every item in the GIMP Procedure database has a meu item and similarly not ever Verb in inkscape needs or deserves a menu item).
Hope it makes sense what I'm trying to get at here, even if I might sound a little paranoid about clutter than hasn't happened yet.
On 1/22/07, ryan lerch <ryanlerch@...400...> wrote:
i am wondering if there is a command for the inkscape command line that allows an svg's document boundry to be reduced to fit tight around all the elements.
What do you need it for? If for bitmap export, then you already have this option, --export-area-drawing. So while you can't do this as an svg-to-svg conversion, you can crop it when you export the bitmap through Inkscape, which may be sufficient for your case.
On Mon, 2007-01-22 at 23:05 -0400, bulia byak wrote:
On 1/22/07, ryan lerch <ryanlerch@...400...> wrote:
i am wondering if there is a command for the inkscape command line that allows an svg's document boundry to be reduced to fit tight around all the elements.
What do you need it for? If for bitmap export, then you already have this option, --export-area-drawing. So while you can't do this as an svg-to-svg conversion, you can crop it when you export the bitmap through Inkscape, which may be sufficient for your case.
Open Clip Art Library needs to be able to modify an SVG so that the canvas size/viewport is the same as the largest width and height of any object in a file.
Hence, why I want to just add the commandline option to do this in-place like vacuum. It will save massive time and would be useful for others needing and using inkscape to generate galleries, etc...otherwise, there is massive whitespace in files, depending upon how an author saves their svg and submits it to SVG...
Yes, if you can think of another way of doing this easily and from the commandline, please let me know...otherwise, I tested what you recommended and it does not give the results sought.
In the code, this flag only allows for exporting of PNG:
if (sp_export_png || sp_export_id || sp_export_area_drawing) { sp_do_export_png(doc); }
Thus, there are two ways to move ahead to attain this functionality, make sp_export_area_drawing option export more than just png amd allow generic Inkscape SVG and just plain-svg options from the commandline so that export also can export SVG. Or, the approach I outlined previously...either is fine with me...thoughts?
Jon
Well, if you really need this as svg-to-svg, then it's better to create a new option for that, not overload --export-area-drawing.
On Mon, 22 Jan 2007, Jon Phillips wrote:
Date: Mon, 22 Jan 2007 20:16:40 -0800 From: Jon Phillips <jon@...235...> To: bulia byak <buliabyak@...400...> Cc: Inkscape is a vector graphics editor inkscape-devel@lists.sourceforge.net Subject: Re: [Inkscape-devel] command line operation to reduce document boundry
On Mon, 2007-01-22 at 23:05 -0400, bulia byak wrote:
On 1/22/07, ryan lerch <ryanlerch@...400...> wrote:
i am wondering if there is a command for the inkscape command line that allows an svg's document boundry to be reduced to fit tight around all the elements.
What do you need it for? If for bitmap export, then you already have this option, --export-area-drawing. So while you can't do this as an svg-to-svg conversion, you can crop it when you export the bitmap through Inkscape, which may be sufficient for your case.
Open Clip Art Library needs to be able to modify an SVG so that the canvas size/viewport is the same as the largest width and height of any object in a file.
It is not really that simple and there will be cases where doing that results in even worse looking thumbnails. (I do understand why you are doing this, I remember opening far too many Sodipodi documents and wondering where the drawing was because a very small drawing was stuck at the bottom of an A4 page.)
Also I made a habit of writing my name or other annotation off page so that it would appear only in editing programs like inkscape but not in most cases such as viewers or thumbnailers.
There will always be a few corner cases that look terrible if you try to entirely automate thumbnail generation, guidelines for clipart authors might help reduce the number of dodgy submissions though.
That would be excellent to automate that transformation since more than 90% of all the cleanup work is bounding box reducing...
Molumen
----- Original Message ----- From: "ryan lerch" <ryanlerch@...400...> To: "Inkscape is a vector graphics editor" inkscape-devel@lists.sourceforge.net Sent: Tuesday, January 23, 2007 12:20 AM Subject: [Inkscape-devel] command line operation to reduce document boundry
i am wondering if there is a command for the inkscape command line that allows an svg's document boundry to be reduced to fit tight around all the elements.
If there is not one, it sure would be handy for us over at the openclipart library...
cheers,
ryanlerch
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=D... _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
participants (5)
-
Alan Horkan
-
bulia byak
-
Jon Phillips
-
momo
-
ryan lerch