how to extract PUML code from SVG file

0 votes
asked Apr 25 in Question / help by Largo (180 points)

Hi,

I follow the official instruction
I use the official Hello world example provided in the wiki

I save the hello world diagram in both PNG and SVG formats:
HelloWorld.png
HelloWorld.svg
both files open successfully and show the same diagram as a picture.

Now, let's do the reverse process convert image to code.

test 1: PNG

java -jar plantuml.jar -metadata HelloWorld.png > HelloWorld_png.puml

the output is correct, I see the code in file HelloWorld_png.puml:

------------------------
HelloWorld.png

@startuml
start
:Hello world;
stop
@enduml

PlantUML version 1.2025.3beta5(Unknown compile time)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: US

------------------------

test 2: SVG

java -jar plantuml.jar -metadata HelloWorld.svg > HelloWorld_svg.puml

The output is wrong, I see the code in file HelloWorld_svg.puml:

------------------------
HelloWorld.svg

------------------------

However, I see the PUML code in the command line:

C:\testPUML>java -jar plantuml.jar -metadata HelloWorld.svg > HelloWorld_svg.puml

@startuml
start
:Hello world;
stop
@enduml

C:\testPUML>

strangely, the command line doesn't show the code when the input file is PNG.

This is very inconvenient.

I know the old version of plantUML.jar (4 years ago) works but I don't have it anymore. Is it possible to download the 4-year old file from somewhere safe?
I can share my 2 image files if that helps.
Of have I misread the user guide?

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...