On 8/26/06, A. B. Schmidt <abschmidt@...155...> wrote:
I've only recently - since the 0.44 release - started using Inkscape (I was waiting for the layers pallet.) Once I got the hang of the export bitmap dialog box, I was pretty happy. Currently I have a layer on top of my full page mockup called "export" (which could just as easily be called "slices"). On that layer I have a set of unfilled, unstroked rectangles. Each rectangle has the id set to a unique name (header_bg, button_bg, etc.) and when I need to export a .png to be referenced by my .css file, I select the rectangle choose File->Export Bitmap, click the Selection tab, and export the selection out at 90 dpi. All is well.
That's exactly what I use, too.
But sometimes - typically after I've had sign-off on a full page illustration, but before I've started my HTML mockup - I need to export all the selection rectangles at once, and I haven't really found a way in Inkscape to do this. From the mailing lists I know that there was an extension (SVGslice) that exported slices and html, but I'm having trouble running it on XP, and don't really need the .html anyway.
Well, in my case there's rarely more than a couple dozen export areas, and it's easy to switch to "Export" layer and repeat "press Tab, click Export" sequence that many times. You don't really need to think or watch anything when you're doing this: Tab is guaranteed to traverse all objects in the current layer ("Export"), and the Export dialog fills in the export filename for each rectangle automatically. So it's done very quickly, and I don't see the need to automate it further if I have to do it a couple times maximum.
However, if my file has many dozens of export areas (e.g. a large icon collection), or if I need to export them all often, then I would write a script or batch file for automated export. All that is needed for this is the list of all IDs in the Export layer. Then for each ID I add a command:
inkscape --export-id=ID -t document.svg
Then I just run this batch file to export everything at once.
See http://www.inkscape.org/doc/inkscape-man.html for details on command line parameters.
In the future, as browser support improves, I'd also like to be able to export individual .svg objects that would be referenced by the .css or .html files.
And we will need to add another export hint stored for each exported object: not only filename and resolution but also export format.
not sure if I'm asking the tool to do something (save multiple selections as bitmaps to a directory of my choosing, and warn me if I'm overwriting an existing file) that it was never intended to do.
Certainly this is something Inkscape should be able to do. The batch file solution works for me, but if someone can do a more GUI-based and user-friendly solution for this, it would be nice. This has already been proposed, we just need a volunteer to take this on.