title: Can anyone explain the below code.What is the line which calculates no of pages in document
body: <pre><code>var x=window.location.search.substring(1).split('&amp;');
  for (var i in x)
  {
      var z=x[i].split('=',2);
      vars[z[0]] = unescape(z[1]);
  }
  var x=['frompage','topage','page'];
  for (var i in x)
  {
      var y = document.getElementsByClassName(x[i]);
      for (var j=0; j&lt;y.length; ++j)
          y[j].textContent = vars[x[i]];
  } 
  </code></pre>
  
  <p>Basically our application is using <strong>wkhtmltopdf</strong> utility, and we want to modify this code so that header is not included on the last page of pdf. please suggest.</p>