それは、あなたに役立つ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
を
問題は私ですnテーブル幅。 – user254153
あなたのページのマージンが '15px'をセットすることでデフォルトになったら、テーブルを100%幅にする方法は? あなたのレイアウトが100%幅として機能していないため、デフォルトのマージンが得られていると思います。 – AHJeebon
いいえ、記載されている段落は100%の幅をカバーしています。唯一の問題はテーブルの幅です。 – user254153