Jump to content

Help with TCPDF image alignment

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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...