Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TCPDF add line across page in header

Tags:

php

tcpdf

I have created a custom header for my PDF created with TCPDF. Now I would like to add a blue line (about 2px width) that goes across the page at the bottom of the header but can't figure out how?

like image 302
Billy Avatar asked Nov 28 '22 10:11

Billy


2 Answers

I found the easiest way to put line

$pdf->writeHTML("<hr>", true, false, false, false, '');
like image 40
Vinayak Shedgeri Avatar answered Nov 30 '22 23:11

Vinayak Shedgeri


I believe you do it like this:

$style = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0));

$pdf->Line(5, 10, 80, 30, $style);

Here is the full example

http://www.tcpdf.org/examples/example_012.phps

like image 90
serby Avatar answered Nov 30 '22 23:11

serby