Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 797

Dompdf draw line on every page

$
0
0

I'm trying to generate nice pdf from html file with Dompdf but I'm unable to draw a line on every page. Here is an exemple of the php file.

<?php require_once("dompdf/dompdf_config.inc.php");$html = file_get_contents("test.txt");$html = utf8_decode($html);$dompdf = new DOMPDF();$dompdf->load_html($html);  $dompdf->render();$font = Font_Metrics::get_font("helvetica", "bold");$canvas = $dompdf->get_canvas();$footer = $canvas->open_object();    $canvas->line(10,730,800,730,array(0,0,0),1);    $canvas->page_text(555, 750, "{PAGE_NUM}/{PAGE_COUNT}",                   $font, 10, array(0,0,0));$canvas->close_object();$canvas->add_object($footer, "all");$dompdf->stream("dompdf_out.pdf", array("Attachment" => false));?>

This produce a pdf where each page contain the page number, but only the last page have a line.

So how can i draw line/images on every page with Dompdf ?


Viewing all articles
Browse latest Browse all 797

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>