I am using dompdf version 0.8.3 in all our reports, we have done the adding header and footer in each page. Now we want to have margin-top in each page of our header because our header overlapped to our table.
<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>
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');
Question: Is it possible to have a margins(margin-top to be specific in each page) and to skip the 1st page to have header and page number?
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2U5wfzG
via IFTTT
Aucun commentaire:
Enregistrer un commentaire