} } $BadgePerPage = count($Badges); $Just = array('L', 'C', 'R'); $cntPass = 0; $pdf = new LabelPDF($PageWidth, $PageHeight); // get the background of the card $q = safe_r_SQL("select * from IdCards where IcTournament={$_SESSION['TourId']}"); $BackGround = safe_fetch($q) or debug_svela('Error in Accreditation!'); $BackGround->Options = unserialize($BackGround->IcSettings); $Elements = array(); $q = safe_r_SQL("select * from IdCardElements where IceTournament={$_SESSION['TourId']} order by IceOrder"); while ($r = safe_fetch($q)) { $r->Options = unserialize($r->IceOptions); if (!empty($r->Options['Font'])) { $r->Options['FontFamily'] = $pdf->addTTFfont(K_PATH_FONTS . $r->Options['Font'] . '.ttf'); $r->Options['FontStyle'] = (substr($r->Options['Font'], -2, 1) == 'b' ? 'B' : '') . (substr($r->Options['Font'], -1, 1) == 'i' ? 'I' : ''); } if ($r->IceType == 'Accomodation') { // calculate the final dimentions regard the space we have.... $OrgAcScaleFactor = ($r->Options['H'] - 4) / $AcHeight; } $Elements[] = $r; } while ($MyRow = safe_fetch($Rs)) { $pdf->SetDefaultColor(); if ($cntPass == 0) { $tmp = $pdf->addPage(); } $StartX = $Badges[$cntPass][0]; $StartY = $Badges[$cntPass][1];