Skip to content

Instantly share code, notes, and snippets.

@julienb74
Forked from gka/map2pdf.js
Created March 23, 2012 22:24
Show Gist options
  • Save julienb74/2175671 to your computer and use it in GitHub Desktop.
Save julienb74/2175671 to your computer and use it in GitHub Desktop.
Rendering a Kartograph map to PDF using PhantomJS
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