title: TCPDF How to set top margin in header
body: <p>I am having an issue with TCPDF in that I am trying to set the Y value for the first line of text to be printed on the page after the header has been output and it's being ignored. My header routine is in an extended TCPDF class as follows:</p>
  
  <pre><code>public function Header() {
                  $this-&gt;setJPEGQuality(90);
                  $this-&gt;Image('/www/images/hdrlogo.gif', 5, 20, 150, 0, 'GIF', 'https://www.example.com');
                  $this-&gt;SetFont(PDF_FONT_NAME_MAIN, 'B', 14);
                  $this-&gt;SetY(23);
                  $this-&gt;cell(0,20,"Activity Report",0,0,"R");
                  $this-&gt;SetFont(PDF_FONT_NAME_MAIN, 'R', 11);
                  $when=date("m/d/Y");
                  $this-&gt;SetY(41);
                  $this-&gt;cell(0,20,"Prepared $when",0,0,"R");
                  $this-&gt;Line(170,43,587,43);
                  $this-&gt;SetY($this-&gt;topMargin);           
          }
  </code></pre>
  
  <p>Regardless of the value in $this->topMargin the Y value is unaffected after the header has been output. The reason I need to set the Y value is that when a HTML overflows the page I need to have the overflow text start on the page after the header information. The headers look fine on the page. Is this the correct way to do this or is there another way within TCPDF?</p>