Monday 1 May 2023

Inkscape 1.2 Extension: Sibelius Viewbox

 This is an extension for Inkscape 1.2 for correcting SVG-files that were exported by Sibelius via the graphic selection tool.

These SVG are always the full page with 4 white rectangles that cover the unwanted area. The page size and viewbox isn't set correctly to show only the selected area.

 The extension will correct this and has the options to

- remove the white cover boxes
- remove all elements that are outside the page (most of it). 



Installation:

On Windows extract the zip file into something like this path:
C:\Users\yourname\AppData\Roaming\inkscape\extensions\ 

To find and open the correct folder you can also open Inkscape->Edit->Preferences->System->User Extensions->Open

After installation and restart Inkscape you can run the extension in "Extensions"->Document->Sibelius Viewbox. 

 

Usage as .bat-file to process multiple SVGs:

As it is a python script it also can be used to batch process multiple files via command line. 

Put this line into a text-file, edit the paths (yourname) and save as SibeliusViewbox.bat:

for %%a in (%*) do python.exe "C:\Users\yourname\AppData\Roaming\inkscape\extensions\SibeliusViewbox\SibeliusViewboxExtension.py" --remove_whiteboxes=True --remove_elements=True %%a > %%a_viewbox.svg 

 An example .bat-file is included.

Once created you can drag and drop multiple SVGs onto the SibeliusViewbox.bat-file and the script will generate the corrected SVGs.

Note: If Inkscape is not installed in "C:\Program Files\" you must edit the Python script.

 

Add .bat-file to Send-to-Menu:

You can add the .bat-file to the Windows Send-to-menu.

Open Windows-Explorer and insert this into the address-bar: shell:sendto

This opens the Send-to-folder. Copy the .bat-file into it.

Now you can select all your SVGs, right click -> Send-to -> SibeliusViewbox.bat

 

Download: SibeliusViewbox.zip

Or from Inkscape Extension Page: sibelius-viewbox
 




No comments:

Post a Comment