$max_width = 150; $image = "images/" . $qms_text; $image_size = GetImagesize($image); $image_height = $image_size[1]; $image_width = $image_size[0]; $height = $image_height / $image_width * $max_width; if ($pdf->GetY() + $height > 270) { $pdf->addPage(); } UpDate($qms_date); $pdf->SetTextColor(180); $pdf->SetFont('Helvetica', '', 5); $pdf->Cell(15, 5, $number, 0, 0, R); $x = $pdf->GetX(); $y = $pdf->GetY(); $pdf->Image($image, $x, $y, $max_width, $height); $y = $pdf->GetY() + $height + 2; $pdf->SetY($y); unset($x); unset($y); } elseif ($qms_toc4 > 0 && $qms_type == "check") { if ($pdf->GetY() > 260) { $pdf->addPage(); } UpDate($qms_date); $pdf->SetTextColor(180); $pdf->SetFont('Helvetica', '', 5); $pdf->Cell(15, 5, $number, 0, 0, R); $pdf->SetTextColor(0); $pdf->SetLineWidth(0.5); $pdf->SetDrawColor(100);