Is there a way to print a square border on each page of a multi-page PDF rendered using wkhtmltopdf, similar to the question asked here: Add borders to each printed page with CSS?
I generate an HTML page as a variable and utilize snappy from https://github.com/KnpLabs/snappy to convert it into a PDF.
$html = $this->load->view('print/report_baseline_print',$data,TRUE);
$snappy = new \Knp\Snappy\Pdf('path to wkhtmltopdf -O landscape');
$tmp = random_temp_file('.pdf');
$snappy->generateFromHtml($html,$tmp);
$filename = 'Baseline-report.pdf';
$this->output
->set_header("Cache-Control: no-cache, must-revalidate")
->set_header("Content-Disposition: filename=$filename;")
->set_content_type('application/pdf')
->set_output(read_file($tmp));
delete_file($tmp);
Despite trying various methods, such as:
....
<style>
section:not(:last-child){
page-break-after: always;
}
.box{
border:1px solid black;
position:fixed;
top:10mm;
right:10mm;
bottom:10mm;
left:10mm;
}
</style>
</head>
<body>
<section id='page1'>
<div class='box'></div>
</section>
<section id='page1'>
<div class='box'></div>
...
The issue persists where the box breaks over the page. Any suggestions on how to successfully achieve a thin black border printing on each page at a 10mm margin? It seems that the wkhtmltopdf program is not handling the standard print CSS effectively...