Export to SVG is different between CLI and GUI

• Nov 11, 2023 - 15:01

Hi,
when exporting to SVG, the result is sligtly different between using CLI "mscore -o output.svg input.mscz" and the Export/SVG dialog in the GUI. When opening the CLI-SVG in Inkscape and selecting all (CTRL-A) not only the printed area is selected but the whole page including blank areas. When doing the same with the GUI-generated SVG, only the musical output is selected. With the GUI-SVG file, I can simply press CTRL-SHIFT-G to "crop" (set page-size to selection) to selection. With the CLI-SVG file, I need to delete that empty background-like object, to be able to reduce the page-size.

The only difference in exported SVG files is an additional line after the <desc> in CLI-SVG file, which gets converted to object "path1" when opened and saved in Inkscape:

<path class="" fill="#ffffff" fill-rule="evenodd" d="M0,0 L1672.44,0 L1672.44,4251.96 L0,4251.96 L0,0 "/>

This is not a big deal for a few SVGs but I have to handle some hundrets and want to crop and convert SVG with command-line options of Inkscape like this (just as a reference for those interested):
inkscapecom --export-type="svg" --export-area-drawing "Lit1-0.svg"
inkscapecom --actions="select-all;page-fit-to-selection;export-type:svg;export-do" "Lit1-0.svg"

BR
JP

Do you still have an unanswered question? Please log in first to post your question.