Query Options

The query options allow you to determine position and size information for any object in an SVG file. The key here is knowing the ID (name) of the object for which you desire the information. The ID name must be given. The exported numbers use the SVG coordinate system.

Here is an example of finding the x position of the zoom-in icon in the default icon file on a Linux system:

inkscape --query-id=zoom_in -X /usr/share/inkscape/icons/icons.svg

-I, --query-id

Specify the ID of the object for a query.

-S, --query-all

New in v0.46.

Return a comma separated list of id, x, y, w, and h for all objects (including SVG file, Livelli, and Gruppi) in file. Each object is on its own line.

Here is an example from querying MyStar.svg (used in the example at the start of this chapter).

svg2293,26.447175,24,97.105652,92.450851
layer1,26.447175,24,97.105652,92.450851
MyStar,26.447175,24,97.105652,92.450851
-X, --query-x

Ask for the x position of an object.

-Y, --query-y

Ask for the y position of an object.

-W, --query-width

Ask for the width of an object.

-H, --query-height

Ask for the height of an object.