title: Header height and positioning header from top of page in wkhtmltopdf
body: <p>In my application, the user is allowed to define his own headers and margins for printing.
  For the header, the user can provide the following two fields:</p>
  
  <ul>
  <li>(a) Page Top Margin in mm (from top of the page)</li>
  <li>(b) Header Margin in mm (from top of the page)</li>
  </ul>
  
  <p>The fields (a) and (b) are as shown in the figure below:
  <img src="https://i.stack.imgur.com/x2ZHS.jpg" alt="Margins depiction"></p>
  
  <p>For example, if the user provides (a) as 10mm and (b) as 100mm, then the height of the 'Header Region' would be 90mm.</p>
  
  <p>Now the content within the header needs to be aligned at the top of the Header Region.</p>
  
  <p>Is there a way to set the Header Region Height and to top-align the content within this header region.</p>
  
  <p>At present, i am doing the following for the <strong>header-html</strong> option:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
  
      &lt;style type="text/css"&gt;
          body 
          {
              border:0; 
              margin: 0;
              padding: 0;
              height: 90mm;  //in actual program, this is set dynamically in PHP
          }
      &lt;/style&gt;
  
      &lt;script type="text/javascript"&gt;
      function subst() 
      {
          //process the GET parameters and accordingly set the Header Region text info
      }  
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body onload="subst()"&gt;
      &lt;div&gt;
          //text
      &lt;/div&gt;
  &lt;/body&gt;  
  &lt;/html&gt;
  </code></pre>
  
  <p>The <strong>margin-top</strong> option is being set as 100mm.</p>
  
  <p>I have tried setting <em>vertical-align: top</em> for the <em>body</em> CSS, But that too did not work.</p>
  
  <p>The final output that I achieve does not seem to have the Header Region content vertical aligned in either top or middle. It is somewhere a little above the middle of the Header Region.</p>