Skip to content

Instantly share code, notes, and snippets.

@Rami-Majdoub
Last active July 3, 2025 03:28
Show Gist options
  • Save Rami-Majdoub/e057d2c30ed19da61ab9a8d4b03be99e to your computer and use it in GitHub Desktop.
Save Rami-Majdoub/e057d2c30ed19da61ab9a8d4b03be99e to your computer and use it in GitHub Desktop.
remove UNREGISTERED from StarUML
  • export as SVG (File > Export Diagram As > SVG... > Save)
  • open SVG file in web browser
  • open console and run
document.querySelectorAll("text").forEach(e => e.innerHTML = e.innerHTML === "UNREGISTERED"? "":e.innerHTML)
  • take screenshot
@afgomz
Copy link

afgomz commented Mar 29, 2024

is there any to achieve that if I'm using ubuntu? if so, please let me know how to

@cp-prashanthrao
Copy link

Just open the SVG file in a text editor and replace the UNREGISTERED text with empty

@Vaalus
Copy link

Vaalus commented Nov 22, 2024

Thank you

@omaralian98
Copy link

Removing it would be better I think :)
document.querySelectorAll("text").forEach(e => e.textContent === "UNREGISTERED" && e.remove());

@Sakthi-Developer
Copy link

Sakthi-Developer commented Jan 4, 2025

from bs4 import BeautifulSoup 

def edit_svg_file(input_file_path, output_file_path):
    try:
        
        with open(input_file_path, 'r', encoding='utf-8') as file:
            svg_content = file.read()

        
        soup = BeautifulSoup(svg_content, 'xml')

        
        for text_element in soup.find_all('text'):
            if text_element.string == "UNREGISTERED":
                text_element.string = ""

        with open(output_file_path, 'w', encoding='utf-8') as file:
            file.write(str(soup))
        
        print(f'SVG file updated successfully and saved to {output_file_path}')
    except Exception as e:
        print(f'Error: {e}')

input_file_path = r"C:\Users\testuser\Downloads\UseCaseDiagram1.svg"   #Update this with your source path
output_file_path = r"C:\Users\testuser\Downloads\output.svg"

edit_svg_file(input_file_path, output_file_path) 

To Run this

pip install beautifulsoup4

Then run it

@abdelhakim97
Copy link

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment