Jump to content

Help with TCPDF image alignment


honkmaster
 Share

Recommended Posts

Hi, Im have a trouble understand how I align the image to centre vertical and horizontally any help would be great, Cheers Chris

// Image Box
$pdf->setCellPaddings(0, 0, 0, 0);
$pdf->SetFillColor(255, 255, 255);
$pdf->SetDrawColor(0, 0, 0);
$pdf->Rect(10, 117, 188, 137, 'DF');
$pdf->Image('Upload/94428_075_10% Data Capture cards.jpg', 15, 122, 180, 125, 'JPG', '', '', false, 300, 'C', false, false, 0, true, false, false);
Link to comment
Share on other sites

Ok I worked it out, under fitbox i had used true, you can use 2 charters here 'CM' the center and middle

 

 

$fitbox (mixed) If not false scale image dimensions proportionally to fit within the ($w, $h) box. $fitbox can be true or a 2 characters string indicating the image alignment inside the box. The first character indicate the horizontal alignment (L = left, C = center, R = right) the second character indicate the vertical algnment (T = top, M = middle, B = bottom).
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...