wavedrom / cli

CLI for WaveDrom
https://wavedrom.com
MIT License
61 stars 12 forks source link

Write to stdout on '-' for svg #9

Closed witchard closed 7 years ago

witchard commented 7 years ago

I would do PNG too, but my javascript and knowledge of phantomjs isn't good enough. There seems to be a renderBase64() function, but when passing that through atob() and then to system.stdout.write() that doesn't generate a correct PNG. It looks to be some form of weird encoding issue as just writing the result of renderBase64() and then decoding it on the command line (base64 -D on my mac) does produce a valid png.

drom commented 7 years ago

@witchard I will take a look on PNG case

drom commented 7 years ago

@witchard unfortunately, for writing PNG or PDF I use internal Phantom renderer:

page.render(pngFileName);

Phantom looks at pngFileName extension and decides what data to render and save on disk.