I am using dompdf version 0.8.3. We added some header in each page but we want the header will only appear on the 2nd page onwards.
What we have right now is we have header and footer on each page but we want to display the 'P O #: number ?> when the page is 2nd page onwards.
Controller
<!-- 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');
<style type="text/css">
@page {
margin-top: 40px !important;
margin-bottom: 50px !important;
}
</style>
<div class="page-break">
<div id="page-wrap">
<script type="text/php">
if (isset($pdf)) {
$x = 25;
$y = 800;
$text = "page {PAGE_NUM} of {PAGE_COUNT}";
$page_num = "{PAGE_NUM}";
$text2 = "This is a system generated document";
$font = 'Arial';
$size = 11;
$color = array(0.333,0.333,0.333);
$word_space = 0.0; // default
$char_space = 0.0; // default
$angle = 0.0; // default
// header
$pdf->page_text(500,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);
// generated
$pdf->page_text(410, $y, $text2, $font, $size, $color, $word_space, $char_space, $angle);
}
</script>
</div>
</div>
Question: Is it possible to skip the 1st page to have the header?