title: Phantom JS - clipRect - Javascript Help
body: <p>i'm using phantom js to screen shot a page</p>
  
  <p><a href="http://code.google.com/p/phantomjs/wiki/QuickStart#Rendering" rel="nofollow">http://code.google.com/p/phantomjs/wiki/QuickStart#Rendering</a></p>
  
  <p>it has a feature called clipRect</p>
  
  <p><a href="http://code.google.com/p/phantomjs/wiki/Interface#clipRect_(object" rel="nofollow">http://code.google.com/p/phantomjs/wiki/Interface#clipRect_(object</a>)</p>
  
  <p>can someone show me how i would modify the following code to us clipRect so i only get a partial screenshot and not the whole thing?</p>
  
  <pre><code>if (phantom.state.length === 0) {
  if (phantom.args.length !== 2) {
      console.log('Usage: rasterize.js URL filename');
      phantom.exit();
  } else {
      var address = phantom.args[0];
      phantom.state = 'rasterize';
      phantom.viewportSize = { width: 600, height: 600 };
      phantom.open(address);
  }
  } else {
      var output = phantom.args[1];
      phantom.sleep(200);
      phantom.render(output);
      phantom.exit();
  }    
  </code></pre>