特定页面上的呼叫标头


Call header on specific pages

我使用mpdf生成动态PDF。我陷入了一种情况,标题应该在一些特定的页面上调用,比如如果我有10页,那么它应该在第5、6、7和9页上调用。

如何做到这一点?

我不确定,但看到下面的URL,我认为它对你非常有帮助

在PHP 中使用DOMPDF的PDF页面标题

或者试试这个

//您的dompdf设置

$dompdf = new DOMPDF();
// add the header
$canvas = $dompdf->get_canvas();
$font = Font_Metrics::get_font("helvetica", "bold");
// the same call as in my previous example
$canvas->page_text(72, 18, "Header: {PAGE_NUM} of {PAGE_COUNT}",
                   $font, 6, array(0,0,0));
$dompdf->load_html($html);