Created
March 22, 2012 18:44
-
-
Save gka/2161580 to your computer and use it in GitHub Desktop.
Rendering a Kartograph map to PDF using PhantomJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var page = new WebPage(), | |
url = "http://kartograph.org/showcase/italia/", | |
output = "italia.pdf"; | |
page.viewportSize = { width: 1100, height: 750 }; | |
page.open(url, function (status) { | |
if (status !== 'success') { | |
console.log('Unable to load the address!'); | |
} else { | |
window.setTimeout(function () { | |
page.render(output); | |
phantom.exit(); | |
}, 200); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment