title: Strange getting width of page in phantomjs
body: <p>here is the script code:</p>
  
  <pre><code>var page = require('webpage').create();
  
  page.paperSize = {
    format: 'A4', 
    orientation: "landscape"
  };
  
  page.open('http://www.google.com', function () {
  
    var arr = page.evaluate(function () {
       var pageWidth = document.body.clientWidth;
       var pageHeight = document.body.clientHeight;
  
       return [pageWidth, pageHeight];
    });
  
    console.log('pagwWidth: ' + arr[0] + '; pageHeight: ' + arr[1]);
  
    page.render('google.pdf');
    phantom.exit();    
  });
  </code></pre>
  
  <p>I'm trying to get clientWidth and clientHeight of document.body page. When I exec this script I'm getting the folowing values:</p>
  
  <pre><code>pagwWidth: 400; pageHeight: 484
  </code></pre>
  
  <p>Why is the width above is 400px? I think I should be wider.</p>
  
  <hr>
  
  <p>Thank you for the reply. But then I don't understand the following thing. When I use viewportSize = {width: 1024, height: 800}</p>
  
  <pre><code>var page = require('webpage').create();
  
  page.paperSize = {
    format: 'A4', 
    orientation: "landscape"
  };
  
  page.viewportSize = {width: 1024, height: 800};
  page.open('http://www.google.com', function () {
  
    page.render('google.pdf');
    phantom.exit();    
  });
  </code></pre>
  
  <p>I get the following file:
  <img src="https://i.stack.imgur.com/C5PDY.png" alt="enter image description here"></p>
  
  <p>But if I use viewportSize = {width: 400, height: 400}</p>
  
  <pre><code>var page = require('webpage').create();
  
  page.paperSize = {
    format: 'A4', 
    orientation: "landscape"
  };
  
  page.viewportSize = {width: 400, height: 400};
  page.open('http://www.google.com', function () {
  
    page.render('google.pdf');
    phantom.exit();    
  });
  </code></pre>
  
  <p>I get the same:
  <img src="https://i.stack.imgur.com/BlDOD.png" alt="enter image description here"></p>
  
  <p>So I don't understand how does viewportSize affect to the view?</p>