var page = require('webpage').create();
//viewportSize being the actual size of the headless browser
page.viewportSize = { width: 720, height: 1080 };
//the clipRect is the portion of the page you are taking a screenshot of
page.clipRect = { top: 0, left: 0, width: 720, height: 1080 };
//the rest of the code is the same as the previous example
page.open('http://mevlana-takvimi.appspot.com/home', function() {
//page.open('http://0.0.0.0:8080/home', function() {
page.render('capture.png');
phantom.exit();
})
//http://0.0.0.0:8080/home
#!/usr/bin/env bash
phantomjs << EOF
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://mevlana-takvimi.appspot.com/home', function() {
page.render('capture.png');
phantom.exit();
})
EOF