Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove line below header and above $html in TCPDF?

Tags:

html

php

pdf

tcpdf

How to remove line below header and above $html in TCPDF?

http://www.tcpdf.org/examples/example_001.pdf

tcpdf.org/examples.php (examples with PDF ang PHP code!)

in this example this is line below http://www.tcpdf.org and above Welcome to TCPDF. How can i remove this?

like image 466
Leo Delkin Avatar asked May 15 '12 13:05

Leo Delkin


3 Answers

As shown on the tcpdf website - examples in exemple 002 there is no header and here is the php code example.

The "magic" is done by this code:

// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);

and that is it! Hope it helps

like image 109
jnhghy - Alexandru Jantea Avatar answered Oct 14 '22 15:10

jnhghy - Alexandru Jantea


You can remove it by subclassing TCPDF class, and overriding the methods Header() and Footer():

class MyTCPDF extends TCPDF
{
   public function Header()
   {
      // NOP! Overrides default header
   }
   public function Footer()
   {
      // NOP! Overrides default footer
   }
}
like image 4
Alberto Arena Avatar answered Oct 14 '22 14:10

Alberto Arena


I V tried writing this code,^_^

it works for both header & footer.

$pdf->setPrintHeader(false);

$pdf->setPrintFooter(false);

like image 3
hello me Avatar answered Oct 14 '22 15:10

hello me