Comment 5 for bug 171476

Revision history for this message
Michele Locati (mlocati) wrote :

I'm using the most recent inkscape version on Windows 64 bit.

Executing `inkscape.com --version` gives me this:
  Inkscape 1.0.2 (e86c870879, 2021-01-15, custom)
      Pango version: 1.48.0

Reading the documentation, it seems that we can export more than one object by separating IDs with semicolons (see https://inkscape.org/doc/inkscape-man.html#i-ID---export-id-OBJECT-ID-OBJECT-ID )

Let's assume we have a file named input.svg with this contents:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   xmlns="http://www.w3.org/2000/svg"
   version="1.1"
   viewBox="0 0 100 50"
>
  <g id="rectangle">
    <rect x="0" y="0" width="50" height="50" />
  </g>
  <g id="circle">
    <circle cx="75" cy="25" r="25" />
  </g>
</svg>

The following commands work as expected:

inkscape.com --export-filename=rectangle.svg "--export-id=rectangle" --export-id-only input.svg

inkscape.com --export-filename=circle.svg "--export-id=circle" --export-id-only input.svg

But when I specify more than one ID, inkscape can't find the objects (except the first one):

inkscape.com --export-filename=both.svg "--export-id=circle;rectangle" --export-id-only input.svg
InkFileExportCmd::do_export_svg: Object rectangle not found in document, nothing to export.

inkscape.com --export-filename=both.svg "--export-id=rectangle;circle" --export-id-only input.svg
InkFileExportCmd::do_export_svg: Object circle not found in document, nothing to export.