Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Line being added to top of each page of PDF

Tags:

pdf

I have just noticed that a line is being added to the top of all PDF pages. I am using TcpdfFpdi v2 from setasign and everything else seems to work as expected (bringing in Pdf pages, adding a logo and text)

Code as follows…

use setasign\Fpdi\TcpdfFpdi;
public  function test($uuid, $date)
{
        $pdf = new TcpdfFpdi();
        $pdf->output('test.pdf', 'D');
}

I would expect this to give me a blank page but it is giving me a page with a line across the top (about 1cm down and in from each side).

like image 972
Shredder Avatar asked Dec 22 '25 04:12

Shredder


1 Answers

Setasign tech support have answered this for me…

This is the default behavior of TCPDF (why ever) and you need to explicitly disable the default header and/or footer:

$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
like image 144
Shredder Avatar answered Dec 24 '25 00:12

Shredder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!