Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set PhantomJS to capture entire screen after using clipRect()

After doing setting page.clipRect followed by page.render, how can you disable clipRect so that subsequent page renders are of the entire viewport?

page.clipRect = {top:0, left:0, height: 10, width: 10} ;
page.render('screencap.png');  // cropped image

page.clipRect = '';
page.render('fullscreen.png');  // still cropped image!
like image 895
Nyxynyx Avatar asked Jan 01 '13 00:01

Nyxynyx


1 Answers

Simply reset all values for clipRect:

page.clipRect = { left:0, top:0, width:0, height:0 }

then PhantomJS will recapture the entire content again.

like image 105
Ariya Hidayat Avatar answered Oct 17 '22 16:10

Ariya Hidayat