How to set margins with TCPDF

212 Views Asked by At

i'm using TCPDF and cannot insert margins in the pages. I want to generate PDFs that include a bleed (trim border after printing).

My PDFs contain images, and when I use SetMargins(), the images stick to the edges. My code :

$unicode = true;
$format = "UTF-8";
$pdf = new TCPDF('P', 'px', 'A4', true, 'UTF-8', false);

$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
$pdf->SetAutoPageBreak(false, 0);

$pdf->SetMargins(100, 100, 100, $keepmargins = true);

$pdf->AddPage('P', array(2480 , 3508));```


Any ideas ?
0

There are 0 best solutions below