Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

right align logo in tcpdf header

I have the following tcdpf syntax in my php document:

$title="My Heading";
$obj_pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.$title, PDF_HEADER_STRING, array(0,64,255), array(0,64,128));

The logo appears on the left, how can I right align the logo and left align $title?

like image 310
Smudger Avatar asked Nov 22 '25 18:11

Smudger


1 Answers

You must define custom header to align image. This example shows how to do this.

To align your logo right, you must set palign attribute to 'R' in image definition.

$this->Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, 'R', false, false, 0,     false, false, false);

Note that, your header data string position may not be what you want as. You will probably

need to play with several attributes, but in basic, image alignment can be done only via

overriding default Header() function as far as I know.

Check also Image() function.

like image 61
alpakyol Avatar answered Nov 24 '25 06:11

alpakyol



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!