markushedvall / node-plantuml

A Node.js module and CLI for running PlantUML
MIT License
189 stars 53 forks source link

Generating dot graph got blank png image #11

Open aleung opened 7 years ago

aleung commented 7 years ago

Generates dot graph from below source, the output png file is blank.

puml generate test.puml -p > test.png
@startdot
digraph foo {
  node [style=rounded]
  node1 [shape=box]
  node2 [fillcolor=yellow, style="rounded,filled", shape=diamond]
  node3 [shape=record, label="{ a | b | c }"]

  node1 -> node2 -> node3
}
@enddot

Generation of svg is ok.

puml generate test.puml -s > test.svg

puml version is 0.5.0

markushedvall commented 7 years ago

I was able to reproduce it, however it's not that the png file is empty. It's missing some information. Some applications could open it, while others couldn't. You could also check the size of the file and see that it's not empty.

So next I tried to use the plantuml jars command line. Without using stdin and stdout the resulting png is fine:

java -Djava.awt.headless=true -jar plantuml.jar -tpng test.puml

However when using stdin and stdout I get a broken png file:

cat test.puml | java -Djava.awt.headless=true -jar plantuml.jar -tpng -p > test.png

So this is problem with plantuml and using stdout and not node-plantuml. From a running a few tests this only seems to be a problem when using dot syntax.