bulia byak wrote:
On 4/22/05, Lee Braiden <lee.b@...786...> wrote:
There are four demo files included, and the coordinates of the slicing in the last one are incorrect. The problem seems to be that Inkscape doesn't respect the units you select in the toolbar for rectangles, but perhaps I'm misunderstanding something there.
You don't actually "set units" for objects. You just choose which unit to use in the UI. Internally, everything is stored in px (numbers without units), and all command line options are in px too.
Currently, I'm not handling unit conversion, and the different inkscape unit options (document, grid, etc.) all have to be set to the same units. I'm sure there's some unit I could treat this as and then convert, but it looks like a bug, since it's in different units from everything else, and seems to resist change.
Exactly what is in different units and resists change?
Do take notice that these px are SVG's "user units". Bulia mentions this below. While there are normally 72 px per inch, there are 90 SVG user units per inch.
Meanwhile, you might be interested in the several new command line options I added recently:
* Determining the dimensions of an object in an SVG document is,
in general case, impossible without fully rendering the entire document. Yet this information can be very useful for various automated tasks, such as building composite SVG documents from objects in separate source documents. Now, to accomplish this, you can run Inkscape with one of the command line options --query-x, --query-y, --query-width or --query-height. The --query-id option specifies the ID of the object that is queried; if not set, the corresponding dimension of the entire drawing is returned. For example:
$ inkscape tutorial-basic.svg --query-height 3998.6800 $ inkscape tutorial-basic.svg --query-y --query-id text1555 528.94486
The returned values are in px (SVG user units). * For PNG export, the new option --export-area-drawing exports the
entire drawing (not canvas), giving you a PNG of all visible objects without margins.
Very interesting. What do you have to say about performance and memory usage when running a second instance of Inkscape from an extension script that is run by the first instance of Inkscape? This question came to mind the first time someone mentioned making an extension out of svgslice. Will the memory usage double, because the document is being parsed into memory twice?
Are options really to follow the filename, as in your examples? I can see how this sort of query will be very useful to extensions.
Aaron Spike