How to delete a line under and above $ html in TCPDF?

How to delete a line under and above $ html in TCPDF?

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

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

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

+3
source share
5 answers

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

The magic is performed using this code:

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

and it's all! Hope this helps.

+17
source

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

class MyTCPDF extends TCPDF
{
   public function Header()
   {
      // NOP! Overrides default header
   }
   public function Footer()
   {
      // NOP! Overrides default footer
   }
}
+3

I V , ^ _ ^

, .

$pdf- > setPrintHeader ();

$ pdf-> setPrintFooter (false);

+3
source

We can edit the file tcpdf.php,

From:

protected $header_line_color = array(0,0,0); 

To:

protected $header_line_color = array(255,255,255);

What is it.

+1
source

Although I prefer jnhghy's selected answer to Jantea Alexandru, the following alternative way to do this is if you just need something quick:

Change the following code:

$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 058', PDF_HEADER_STRING);

to

$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 058', PDF_HEADER_STRING, array(0,0,0), array(255,255,255));

It just sets the line color to white (the background color of the page). The first array of colors is for the color of the title text, the second array of colors is for the color of the title bar.

+1
source

All Articles