var page = require('webpage').create();
//viewportSize being the actual size of the headless browser
page.viewportSize = { width: 1770, height: 750 };
//the clipRect is the portion of the page you are taking a screenshot of
page.clipRect = { top: 0, left: 0, width: 1770, height: 750 };
//the rest of the code is the same as the previous example
page.open('http://220.160.53.33:8903/case/sz22058', function (status) {
if (status !== 'success') {
console.log('Unable to load the address!');
phantom.exit();
} else {
window.setTimeout(function () {
page.render('肿瘤成绩.png');
phantom.exit();
}, 200); // Change timeout as required to allow sufficient time
}
});