mermaid/test/fixtures/samples/load_html_save_screenshot_png.js
2017-09-10 21:23:04 +08:00

17 lines
329 B
JavaScript

// usage: ../../../node_modules/.bin/phantomjs <html> <png>
import system from 'system'
import webpage from 'webpage'
const html = system.args[1]
const png = system.args[2]
console.log('png:', png)
const page = webpage.create()
page.open(html)
page.onLoadFinished = function () {
page.render(png)
global.phantom.exit()
}