$defScoreH = $pdf->GetPageHeight() - $pdf->getTopMargin() * 2; $defScoreW = ($pdf->GetPageWidth() - $defScoreX * 3) / 2; } elseif ($NumDistances == 3) { $defScoreX = $pdf->getSideMargin(); $defScoreH = $pdf->GetPageHeight() - $pdf->getTopMargin() * 2; $defScoreW = ($pdf->GetPageWidth() - $pdf->getSideMargin() * 4) / 3; } else { $defScoreX = $pdf->getSideMargin(); $defScoreW = ($pdf->GetPageWidth() - $pdf->getSideMargin() * 3) / 2; $defScoreH = ($pdf->GetPageHeight() - $pdf->getSideMargin() * 3) / 2; } $defScoreX2 = ($pdf->GetPageWidth() + $pdf->getSideMargin()) / 2; $defScoreY = $pdf->getSideMargin(); $defScoreY2 = ($pdf->GetPageHeight() + $pdf->getSideMargin()) / 2; $MisArray = array(1 => array($defScoreX, $defScoreY), 2 => array($defScoreX2, $defScoreY), 3 => array($defScoreX, $defScoreY2), 4 => array($defScoreX2, $defScoreY2), 5 => array($defScoreX, $defScoreY), 6 => array($defScoreX2, $defScoreY), 7 => array($defScoreX, $defScoreY2), 8 => array($defScoreX2, $defScoreY2)); for ($i = 1; $i <= $NumDistances; $i++) { if ($i == 5) { $pdf->AddPage($NumDistances < 4 ? "L" : "P"); } $Value["Dist"] = $Value["D" . $i]; $Value["CurDist"] = $i; if ($Value["Dist"] != '-') { $pdf->DrawScore($MisArray[$i][0], $MisArray[$i][1], $defScoreW, $defScoreH, $NumEnd, 3, $Value, $Value["Arr" . $i], $Value["Tot" . $i], $Value["gxD" . $i]); } } } safe_free_result($Rs); } } $pdf->Output();