SVG back to PlantUML

0 votes
asked Jul 14, 2022 in Question / help by anonymous
hi all,

I am new in using PlantUML,

initially created sequence diagram and created .SVG, as the idea is that work is "compatible" with confluence.

now I want to re-use that .SVG to make some changes and create a new seq. diagram and .SVG.

SVG is in my local hard disk,

should I build the right URL to decode it back?

can someone , please help,

kind regards

luis
commented Jul 15, 2022 by Martin (8,360 points)

Check out https://plantuml.com/command-line#ce21470ab49d1d19 section on extracting metadata from an image (i think it would work for SVG as well as PNG), it might be what you need.

2 Answers

0 votes
answered Jul 15, 2022 by Martin (8,360 points)

I expected to be able to use the "-metadata" switch on a .svg to extract the source stored in the metadata.  But this returned "null" in my tests.  I'm not sure if this is a bug - the doc only refers to it working with .png, but I can't see why it shouldn't work with .svg as well. 

But the good news is that SVG files are text, so if you load it into a text editor you should be able to find your source code and copy it into a new puml file.

0 votes
answered Jul 16, 2022 by costateixeira (500 points)
Unless you deliberately old plantuml to exclude the source from the svg, the svg should contain the original source as a comment at the end of the file.

For example check the source of this file:

view-source:http://www.plantuml.com/plantuml/svg/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiX8pSd9vt98pKi1IW80
...