es Ihnen helfen kann, Seite von mpdf Konfiguration anpassen:
Fullpage Beispiel:
include 'MPDF/mpdf.php';
$pdf = new mPDF();
$pdf->ignore_invalid_utf8 = true;
$header ="Header html file or code";
$footer ="Footer html file or code";
$content ="Body html or code";
$pdf->SetDisplayMode('fullpage');
$pdf->SetHTMLHeader($header);
$pdf->SetHTMLFooter($footer);
$pdf->WriteHTML($content); // write the HTML into the PDF
$pdf->Output("pdf/test.pdt", 'F'); // save to file because we can
oder können Sie benutzerdefinierte Marge verwenden:
include 'MPDF/mpdf.php';
$pdf = new mPDF();
$pdf->ignore_invalid_utf8 = true;
$header ="Header html file or code";
$footer ="Footer html file or code";
$content ="Body html or code";
$pdf->SetHTMLHeader($header);
$pdf->SetHTMLFooter($footer);
$pdf->AddPage('', // L - landscape, P - portrait
'', '', '', '',
15, // margin_left
15, // margin right
30, // margin top
30, // margin bottom
10, // margin header
10 // margin footer
);
$pdf->WriteHTML($content); // write the HTML into the PDF
$pdf->Output("pdf/test.pdt", 'F'); // save to file because we can
Das Problem ist ich n Tischbreite. – user254153
Wenn der Seitenrand Ihrer Seite standardmäßig auf 15px eingestellt ist. Wie ist es möglich, dass Ihre Tabelle 100% breit ist? Ich denke, Ihr Layout wird standardmäßig Rand, weil Ihre Tabelle nicht als 100% Breite funktioniert. – AHJeebon
Nr. Absatz geschrieben sind 100% Breite abdecken. Das einzige Problem ist die Tischbreite. – user254153