【发布时间】:2019-08-26 06:35:43
【问题描述】:
我在所有报告中都使用 dompdf 版本 0.8.3,我们已经在每个页面中添加了页眉和页脚。现在我们希望在标题的每一页中都有 margin-top,因为我们的标题与我们的表格重叠。
<script type="text/php">
if (isset($pdf)) {
$x = 550;
$y = 800;
$text = "{PAGE_NUM} of {PAGE_COUNT}";
$font = null;
$size = 12;
$color = array(255,0,0);
$word_space = 0.0; // default
$char_space = 0.0; // default
$angle = 0.0; // default
// header
$pdf->page_text(550,10,'P O #: <?= $purchase_order->number ?>',$font,$size,$color,$word_space,$char_space,$angle);
// footer
$pdf->page_text($x, $y, $text, $font, $size, $color, $word_space, $char_space, $angle);
}
</script>
控制器
<!-- My other function/data -->
$pdf = PDF::loadView('purchase-order.export.export-pdf', $data)->setPaper('a4');
$pdf->getDomPDF()->set_option("enable_php", true);
return $pdf->stream('purchase-order-'.$purchase_order->number.'.pdf');
问题:是否可以有一个页边距(每个页面中的页边距顶部)并跳过第一页以获得页眉和页码?
【问题讨论】:
标签: php laravel laravel-5 dompdf export-to-pdf