Created
April 3, 2016 19:51
-
-
Save sputnick-dev/5daa57dc6055f723f9fd7e56e34285e2 to your computer and use it in GitHub Desktop.
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 = require('webpage').create(); | |
//viewportSize being the actual size of the headless browser | |
page.viewportSize = { width: 1024, height: 768 }; | |
//the clipRect is the portion of the page you are taking a screenshot of | |
page.clipRect = { top: 0, left: 0, width: 1024, height: 768 }; | |
//the rest of the code is the same as the previous example | |
page.open('http://phantomjs.org/screen-capture.html', function() { | |
page.render('capture.png'); | |
console.log('Check capture.png'); | |
phantom.exit(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment