Это может помочь вам, настроить страницу из конфигурации MPDF:
Вся страница, например:
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
или вы можете использовать пользовательские края:
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
Проблема i n ширина таблицы. – user254153
Если маржа вашей страницы по умолчанию установлена в '15px', то как можно сделать таблицу шириной 100%? Я думаю, что ваш макет получает маржу по умолчанию, потому что ваша таблица не работает как 100% -ная ширина. – AHJeebon
№ Пункты, написанные, покрывают 100% ширину. Единственная проблема заключается в ширине таблицы. – user254153